From: Antony Dovgal Date: Mon, 2 May 2011 16:17:52 +0000 (+0000) Subject: fix segfault in ext/standard/tests/network/http-stream.phpt X-Git-Tag: php-5.3.7RC1~152 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93ce043480bf65f4479995b88bf0b9fd139108f4;p=php fix segfault in ext/standard/tests/network/http-stream.phpt --- diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 0b82a1e805..7a930fd7ab 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -545,7 +545,7 @@ finish: /* if the user has configured who they are, send a From: line */ { char *from_address = php_ini_string("from", sizeof("from"), 0); - if (((have_header & HTTP_HEADER_FROM) == 0) && from_address[0] != '\0') { + if (((have_header & HTTP_HEADER_FROM) == 0) && from_address && from_address[0] != '\0') { if (snprintf(scratch, scratch_len, "From: %s\r\n", from_address) > 0) php_stream_write(stream, scratch, strlen(scratch)); }