]> granicus.if.org Git - php/commitdiff
MFH: fix possible segfault in #38891
authorAntony Dovgal <tony2001@php.net>
Sat, 23 Sep 2006 11:58:58 +0000 (11:58 +0000)
committerAntony Dovgal <tony2001@php.net>
Sat, 23 Sep 2006 11:58:58 +0000 (11:58 +0000)
ext/standard/url.c

index e842e3dbe14aef63a3e46c139d009693b05721bb..43846bd03729bc71a89e27671c9a05854983c22c 100644 (file)
@@ -678,6 +678,10 @@ PHP_FUNCTION(get_headers)
 
        zend_hash_internal_pointer_reset_ex(HASH_OF(stream->wrapperdata), &pos);
        while (zend_hash_get_current_data_ex(HASH_OF(stream->wrapperdata), (void**)&hdr, &pos) != FAILURE) {
+               if (!hdr || Z_TYPE_PP(hdr) != IS_STRING) {
+                       zend_hash_move_forward_ex(HASH_OF(stream->wrapperdata), &pos);
+                       continue;
+               }
                if (!format) {
 no_name_header:
                        add_next_index_stringl(return_value, Z_STRVAL_PP(hdr), Z_STRLEN_PP(hdr), 1);