fix bug#15499 HttpRequest::addHeaders segfaults when passing array(1)
authorMichael Wallner <mike@php.net>
Mon, 12 Jan 2009 10:12:10 +0000 (10:12 +0000)
committerMichael Wallner <mike@php.net>
Mon, 12 Jan 2009 10:12:10 +0000 (10:12 +0000)
http_request_object.c

index 1b42347ddf1ad9114f02a7e0ef0f0d98e5c9b5b2..c72d90818e7dfeb5b29d3d65f67352c67ea3f585 100644 (file)
@@ -749,7 +749,7 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this
 
 static int apply_pretty_key(void *pDest, int num_args, va_list args, zend_hash_key *hash_key)
 {
-       if (hash_key->nKeyLength > 1) {
+       if (hash_key->arKey && hash_key->nKeyLength > 1) {
                hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength);
        }
        return ZEND_HASH_APPLY_KEEP;