From 3516ee485aa2d683a2ca9b91fa4d0eb4a8761dfb Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Mon, 9 Aug 1999 17:40:28 +0000 Subject: [PATCH] Fix HTTP/ header handling --- main/SAPI.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.40.0