From: Andi Gutmans Date: Mon, 9 Aug 1999 17:40:28 +0000 (+0000) Subject: Fix HTTP/ header handling X-Git-Tag: php-4.0b2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3516ee485aa2d683a2ca9b91fa4d0eb4a8761dfb;p=php Fix HTTP/ header handling --- diff --git a/main/SAPI.c b/main/SAPI.c index c1ee84e9a3..87fe3dd902 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -216,8 +216,10 @@ SAPI_API int sapi_add_header(char *header_line, uint header_line_len) sapi_header.header_len = header_line_len; /* Check the header for a few cases that we have special support for in SAPI */ - if (!memcmp(header_line, "HTTP/", 5)) { + if (header_line_len>=5 + && !memcmp(header_line, "HTTP/", 5)) { SG(sapi_headers).http_status_line = header_line; + return SUCCESS; } else { colon_offset = strchr(header_line, ':'); if (colon_offset) { @@ -238,7 +240,6 @@ SAPI_API int sapi_add_header(char *header_line, uint header_line_len) } else { retval = SAPI_HEADER_ADD; } - if (retval & SAPI_HEADER_DELETE_ALL) { zend_llist_clean(&SG(sapi_headers).headers); }