Patch format-string-bug for PHAR related Bug #53541
Patch version 2010-12-13 19:25 UTC
Return to Bug #53541 |
Download this patch
Patch Revisions:
Developer: crrodriguez@opensuse.org
Index: ext/phar/stream.c
===================================================================
--- ext/phar/stream.c (revisión: 306344)
+++ ext/phar/stream.c (copia de trabajo)
@@ -250,7 +250,7 @@
if (!*internal_file && (options & STREAM_OPEN_FOR_INCLUDE)) {
/* retrieve the stub */
if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "file %s is not a valid phar archive");
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "file %s is not a valid phar archive", resource->host);
efree(internal_file);
php_url_free(resource);
return NULL;
Index: main/php_streams.h
===================================================================
--- main/php_streams.h (revisión: 306344)
+++ main/php_streams.h (copia de trabajo)
@@ -292,7 +292,7 @@
#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC)
#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC)
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...);
+PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
/* php_stream_printf macro & function require TSRMLS_CC */
#define php_stream_printf _php_stream_printf
@@ -548,7 +548,7 @@
php_stream_open_wrapper_ex(Z_STRVAL_PP((zstream)), (mode), (options), (opened), (context)) : NULL
/* pushes an error message onto the stack for a wrapper instance */
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
|