#46887 [Opn->Csd]: -Werror=format-security - compile failure with ext/xmlwriter/php_xmlwriter.c
| From: | iliaa@php.net | Date: | Thu, 18 Dec 2008 20:08:06 +0000 |
| Subject: | #46887 [Opn->Csd]: -Werror=format-security - compile failure with ext/xmlwriter/php_xmlwriter.c | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132161@lists.php.net to get a copy of this message | ||
ID: 46887
Updated by: iliaa@php.net
Reported By: oeriksson at mandriva dot com
-Status: Open
+Status: Closed
Bug Type: XML Writer
Operating System: Mandriva Cooker
PHP Version: 5.2.8
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2008-12-17 21:20:18] crrodriguez at opensuse dot org
Yeah, and there is another one in 5_3
Index: ext/mysqli/mysqli.c
===================================================================
RCS file: /repository/php-src/ext/mysqli/mysqli.c,v
retrieving revision 1.72.2.16.2.17.2.33
diff -u -p -r1.72.2.16.2.17.2.33 mysqli.c
--- ext/mysqli/mysqli.c 27 Nov 2008 19:01:22 -0000
1.72.2.16.2.17.2.33
+++ ext/mysqli/mysqli.c 17 Dec 2008 21:18:33 -0000
@@ -1352,7 +1352,7 @@ if (a) {\
#define LOCAL_INFILE_ERROR_MSG(source,dest)\
memset(source, 0, LOCAL_INFILE_ERROR_LEN);\
memcpy(source, dest, MIN(strlen(dest),
LOCAL_INFILE_ERROR_LEN-1));\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, dest);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"%s", dest);
/* {{{ php_local_infile_init
------------------------------------------------------------------------
[2008-12-17 10:47:04] oeriksson at mandriva dot com
Description:
------------
I get a build error when using -Werror=format-security with
php_xmlwriter.c
Reproduce code:
---------------
Proposed fix:
[oden@oe BUILD]$ cat
php-5.2.8-format_not_a_string_literal_and_no_format_arguments.diff
--- ext/xmlwriter/php_xmlwriter.c 2008-12-16 17:31:11.000000000
+0100
+++ ext/xmlwriter/php_xmlwriter.c.oden 2008-12-16 17:31:54.000000000
+0100
@@ -168,7 +168,7 @@ static zend_object_value xmlwriter_objec
#define XMLW_NAME_CHK(__err) \
if (xmlValidateName((xmlChar *) name, 0) != 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, __err);
\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",
__err); \
RETURN_FALSE; \
} \
Expected result:
----------------
It should build?
Actual result:
--------------
/home/oden/RPM/BUILD/php-5.2.8/ext/xmlwriter/php_xmlwriter.c: In
function 'php_xmlwriter_string_arg':
/home/oden/RPM/BUILD/php-5.2.8/ext/xmlwriter/php_xmlwriter.c:441:
error: format not a string literal and no format arguments
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46887&edit=1