Skip to content

Commit dfdbc4d

Browse files
authored
Fix crash in header injection with invalid user headers (#3403)
Signed-off-by: Bob Weinand <[email protected]>
1 parent 8be4510 commit dfdbc4d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/handlers_http.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ static inline void ddtrace_init_header_keys_set(zend_array *array, header_format
232232

233233
uint32_t idx = 0;
234234
ZEND_HASH_FOREACH_VAL(array, zval *entry) {
235+
if (Z_TYPE_P(entry) != IS_STRING) {
236+
idx++;
237+
continue;
238+
}
239+
235240
zend_string *header_key = ddtrace_extract_header_key(Z_STRVAL_P(entry));
236241
if (!header_key) {
237242
idx++;

0 commit comments

Comments
 (0)