shire Thu Jan 10 20:28:08 2008 UTC
Modified files:
/php-src/ext/standard http.c
Log:
- fix truncation of large values on 64-bit systems in http_build_query
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http.c?r1=1.28&r2=1.29&diff_format=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.28 php-src/ext/standard/http.c:1.29
--- php-src/ext/standard/http.c:1.28 Mon Dec 31 07:12:15 2007
+++ php-src/ext/standard/http.c Thu Jan 10 20:28:08 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: http.c,v 1.28 2007/12/31 07:12:15 sebastian Exp $ */
+/* $Id: http.c,v 1.29 2008/01/10 20:28:08 shire Exp $ */
#include "php_http.h"
#include "php_ini.h"
@@ -121,7 +121,7 @@
*p = '\0';
} else {
/* Is an integer key */
- ekey_len = spprintf(&ekey, 12, "%ld", idx);
+ ekey_len = spprintf(&ekey, 0, "%ld", idx);
newprefix_len = key_prefix_len + num_prefix_len
+ ekey_len + key_suffix_len + 3 /* %5B */;
newprefix = emalloc(newprefix_len + 1);
p = newprefix;
@@ -172,7 +172,7 @@
if (num_prefix) {
smart_str_appendl(formstr, num_prefix,
num_prefix_len);
}
- ekey_len = spprintf(&ekey, 12, "%ld", idx);
+ ekey_len = spprintf(&ekey, 0, "%ld", idx);
smart_str_appendl(formstr, ekey, ekey_len);
efree(ekey);
}
@@ -198,10 +198,10 @@
break;
case IS_LONG:
case IS_BOOL:
- ekey_len = spprintf(&ekey, 12, "%ld",
Z_LVAL_PP(zdata));
+ ekey_len = spprintf(&ekey, 0, "%ld",
Z_LVAL_PP(zdata));
break;
case IS_DOUBLE:
- ekey_len = spprintf(&ekey, 48, "%.*G",
(int) EG(precision), Z_DVAL_PP(zdata));
+ ekey_len = spprintf(&ekey, 0, "%.*G",
(int) EG(precision), Z_DVAL_PP(zdata));
break;
default:
/* fall back on convert to string */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php