Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Avoid dangling pointer in curl header.str
This commit is contained in:
Nikita Popov 2021-08-31 17:24:30 +02:00
commit db055fdb89

View file

@ -1638,9 +1638,7 @@ static int curl_debug(CURL *cp, curl_infotype type, char *buf, size_t buf_len, v
if (ch->header.str) { if (ch->header.str) {
zend_string_release_ex(ch->header.str, 0); 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; return 0;