diff options
author | Brian Shire <shire@php.net> | 2008-01-10 20:29:12 +0000 |
---|---|---|
committer | Brian Shire <shire@php.net> | 2008-01-10 20:29:12 +0000 |
commit | 8a37504831d09c70b22717aa10360152e8c571ae (patch) | |
tree | 4b55cb911d4bb21f2b1e0d22b161b7a50d03c7cd | |
parent | 38ac30162f9d58b0471436867fbb3381ade6facc (diff) | |
download | php-git-8a37504831d09c70b22717aa10360152e8c571ae.tar.gz |
- MFH fix truncation of large values on 64-bit systems in http_build_query
-rw-r--r-- | ext/standard/http.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/standard/http.c b/ext/standard/http.c index 9f49231790..09253145ab 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -105,7 +105,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, *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 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, 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 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, 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 */ |