Error arguments in pl_exec.c

Started by Magnus Haganderabout 17 years ago4 messages
#1Magnus Hagander
magnus@hagander.net
1 attachment(s)

I get the following warnings in HEAD

pl_exec.c: In function ‘exec_stmt_raise’:
pl_exec.c:2538: warning: format not a string literal and no format arguments
pl_exec.c:2538: warning: format not a string literal and no format arguments

Attached patch seems right to me - objections?

//Magnus

Attachments:

plexec.difftext/x-diff; name=plexec.diffDownload
Index: pl_exec.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v
retrieving revision 1.224
diff -c -r1.224 pl_exec.c
*** pl_exec.c	5 Nov 2008 00:07:54 -0000	1.224
--- pl_exec.c	20 Nov 2008 14:58:11 -0000
***************
*** 2538,2545 ****
  	ereport(stmt->elog_level,
  			(err_code ? errcode(err_code) : 0,
  			 errmsg_internal("%s", err_message),
! 			 (err_detail != NULL) ? errdetail(err_detail) : 0,
! 			 (err_hint != NULL) ? errhint(err_hint) : 0));
  
  	estate->err_text = NULL;	/* un-suppress... */
  
--- 2538,2545 ----
  	ereport(stmt->elog_level,
  			(err_code ? errcode(err_code) : 0,
  			 errmsg_internal("%s", err_message),
! 			 (err_detail != NULL) ? errdetail("%s", err_detail) : 0,
! 			 (err_hint != NULL) ? errhint("%s", err_hint) : 0));
  
  	estate->err_text = NULL;	/* un-suppress... */
  
#2Gregory Stark
stark@enterprisedb.com
In reply to: Magnus Hagander (#1)
Re: Error arguments in pl_exec.c

Magnus Hagander <magnus@hagander.net> writes:

I get the following warnings in HEAD

pl_exec.c: In function ‘exec_stmt_raise’:
pl_exec.c:2538: warning: format not a string literal and no format arguments
pl_exec.c:2538: warning: format not a string literal and no format arguments

Attached patch seems right to me - objections?

ick. that's actually a security hole. Thankfully it's new code in cvs head.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's Slony Replication support!

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#1)
Re: Error arguments in pl_exec.c

Magnus Hagander <magnus@hagander.net> writes:

Attached patch seems right to me - objections?

Good catch. What gave you these warnings exactly?

regards, tom lane

#4Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#3)
Re: Error arguments in pl_exec.c

Tom Lane wrote:

Magnus Hagander <magnus@hagander.net> writes:

Attached patch seems right to me - objections?

Good catch. What gave you these warnings exactly?

Same here - the new version of gcc.

Will go ahead and apply.

//Magnus