Skip to content

Commit

Permalink
Fix additional NULL byte added to string keys in get_header(), spotte…
Browse files Browse the repository at this point in the history
…d by Ferenc
  • Loading branch information
KalleZ committed Mar 29, 2015
1 parent a7e6687 commit 6a8ab3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/standard/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ PHP_FUNCTION(get_headers)
}

if ((prev_val = zend_hash_str_find(HASH_OF(return_value), Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr)))) == NULL) {
add_assoc_stringl_ex(return_value, Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr) + 1), s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr))));
add_assoc_stringl_ex(return_value, Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr)), s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr))));
} else { /* some headers may occur more then once, therefor we need to remake the string into an array */
convert_to_array(prev_val);
add_next_index_stringl(prev_val, s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr))));
Expand Down

0 comments on commit 6a8ab3d

Please sign in to comment.