]> granicus.if.org Git - php/commitdiff
fix segfault in ext/standard/tests/network/http-stream.phpt
authorAntony Dovgal <tony2001@php.net>
Mon, 2 May 2011 16:17:52 +0000 (16:17 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 2 May 2011 16:17:52 +0000 (16:17 +0000)
ext/standard/http_fopen_wrapper.c

index 0b82a1e8054c32ba7be6b9534d7ac1a828be0d0a..7a930fd7ab915422d675dcf04edf0ee79f5316b2 100644 (file)
@@ -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));
                }