mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Avoid dangling pointer in curl header.str
If buf_len is zero, this would leave behind a dangling pointer to an already released header.str. Make sure this can't happen by always overwriting the pointer. Closes GH-7376.
This commit is contained in:
parent
30e791ed56
commit
8c292a2f9d
@ -1766,9 +1766,7 @@ static int curl_debug(CURL *cp, curl_infotype type, char *buf, size_t buf_len, v
|
||||
if (ch->header.str) {
|
||||
zend_string_release_ex(ch->header.str, 0);
|
||||
}
|
||||
if (buf_len > 0) {
|
||||
ch->header.str = zend_string_init(buf, buf_len, 0);
|
||||
}
|
||||
ch->header.str = zend_string_init(buf, buf_len, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user