moriyoshi Mon Feb 10 15:18:08 2003 EDT
Modified files:
/php4/main SAPI.c
Log:
Fixed possible snprintf problem
# besides snprintf returns int value, not uint / size_t...
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.168 php4/main/SAPI.c:1.169
--- php4/main/SAPI.c:1.168 Mon Feb 10 15:11:10 2003
+++ php4/main/SAPI.c Mon Feb 10 15:18:08 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.168 2003/02/10 20:11:10 moriyoshi Exp $ */
+/* $Id: SAPI.c,v 1.169 2003/02/10 20:18:08 moriyoshi Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -720,12 +720,12 @@
if (call_user_function_ex(CG(function_table), NULL,
&nm_zlib_get_coding_type, &uf_result, 0, NULL, 1, NULL TSRMLS_CC) != FAILURE &&
uf_result != NULL && Z_TYPE_P(uf_result) == IS_STRING) {
char buf[128];
- uint len;
+ int len;
assert(Z_STRVAL_P(uf_result) != NULL);
len = snprintf(buf, sizeof(buf), "Content-Encoding: %s",
Z_STRVAL_P(uf_result));
- if (sapi_add_header(buf, len, 1)==FAILURE) {
+ if (len <= 0 || sapi_add_header(buf, len, 1) == FAILURE) {
return FAILURE;
}
if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary:
Accept-Encoding") - 1, 1) == FAILURE) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php