mirror of
https://github.com/php/php-src.git
synced 2024-11-29 04:46:07 +08:00
fix memleak and possible segfault in HTTP fopen wrapper
This commit is contained in:
parent
35f0411352
commit
307a2259e9
@ -348,7 +348,10 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
|
||||
}
|
||||
smart_str_0(&tmpstr);
|
||||
/* Remove newlines and spaces from start and end. there's at least one extra \r\n at the end that needs to go. */
|
||||
tmp = php_trim(tmpstr.c, strlen(tmpstr.c), NULL, 0, NULL, 3 TSRMLS_CC);
|
||||
if (tmpstr.c) {
|
||||
tmp = php_trim(tmpstr.c, strlen(tmpstr.c), NULL, 0, NULL, 3 TSRMLS_CC);
|
||||
smart_str_free(&tmpstr);
|
||||
}
|
||||
}
|
||||
if (Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval)) {
|
||||
/* Remove newlines and spaces from start and end php_trim will estrndup() */
|
||||
|
Loading…
Reference in New Issue
Block a user