Error arguments in pl_exec.c

Поиск
Список
Период
Сортировка
Искать

Error arguments in pl_exec.c

От:
Magnus Hagander <magnus@hagander.net>
Дата:
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
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... */
  

Re: Error arguments in pl_exec.c

От:
Gregory Stark <stark@enterprisedb.com>
Дата:
Magnus Hagander  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!

Re: Error arguments in pl_exec.c

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Magnus Hagander  writes:
> Attached patch seems right to me - objections?

Good catch.  What gave you these warnings exactly?
		regards, tom lane

Re: Error arguments in pl_exec.c

От:
Magnus Hagander <magnus@hagander.net>
Дата:
Tom Lane wrote:
> Magnus Hagander  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


FAQ