shire           Thu Jan 10 20:29:12 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/standard       http.c 
  Log:
  - MFH 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.14.2.4.2.3.2.2&r2=1.14.2.4.2.3.2.3&diff_format=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.14.2.4.2.3.2.2 
php-src/ext/standard/http.c:1.14.2.4.2.3.2.3
--- php-src/ext/standard/http.c:1.14.2.4.2.3.2.2        Mon Dec 31 07:17:15 2007
+++ php-src/ext/standard/http.c Thu Jan 10 20:29:12 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: http.c,v 1.14.2.4.2.3.2.2 2007/12/31 07:17:15 sebastian Exp $ */
+/* $Id: http.c,v 1.14.2.4.2.3.2.3 2008/01/10 20:29:12 shire Exp $ */
 
 #include "php_http.h"
 #include "php_ini.h"
@@ -105,7 +105,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;
@@ -153,7 +153,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);
                        }
@@ -165,10 +165,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

Reply via email to