summaryrefslogtreecommitdiff
path: root/ext/standard/url.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-09-23 11:58:58 (GMT)
committerAntony Dovgal <tony2001@php.net>2006-09-23 11:58:58 (GMT)
commit39856ab9cb41a1b7ba913fdf98664a558f13c43e (patch)
treec1e1725a2ee9c20765b7c2b4ac39c9ab5c70b679 /ext/standard/url.c
parent46fda147a5d2681dccdc2c1ae186dbfe38669d5a (diff)
downloadphp-39856ab9cb41a1b7ba913fdf98664a558f13c43e.tar.gz
MFH: fix possible segfault in #38891
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r--ext/standard/url.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c
index e842e3d..43846bd 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -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);