]> granicus.if.org Git - php/commitdiff
Fixed unregistered bug [crash in http_build_query()]
authorArd Biesheuvel <abies@php.net>
Fri, 4 Jun 2004 16:54:14 +0000 (16:54 +0000)
committerArd Biesheuvel <abies@php.net>
Fri, 4 Jun 2004 16:54:14 +0000 (16:54 +0000)
ext/standard/http.c

index 7cd909120d5bcbbe6b4ad6a829319551e77a4f8c..0464dced4c95256a518de48c75ad89a3dd7542fd 100644 (file)
@@ -55,7 +55,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
                (key_type = zend_hash_get_current_key_ex(ht, &key, &key_len, &idx, 0, NULL)) != HASH_KEY_NON_EXISTANT;
                zend_hash_move_forward(ht)
        ) {
-               if (key_len && key[key_len-1] == '\0') {
+               if (key_type == HASH_KEY_IS_STRING && key_len && key[key_len-1] == '\0') {
                        /* We don't want that trailing NULL */
                        key_len -= 1;
                }