summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/http_fopen_wrapper.c2
1 files changed, 1 insertions, 1 deletions
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));
}