From: Antony Dovgal Date: Mon, 18 Dec 2006 13:15:18 +0000 (+0000) Subject: fix possible invalid read (reproducible only on big-endian machines) X-Git-Tag: RELEASE_1_0_0RC1~669 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58673959f94c8354891d6d512f9c0b3297f96047;p=php fix possible invalid read (reproducible only on big-endian machines) --- diff --git a/main/SAPI.c b/main/SAPI.c index fe55a2ae98..f3eb0d9398 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -591,7 +591,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) header_line = estrndup(header_line, header_line_len); /* cut of trailing spaces, linefeeds and carriage-returns */ - while(isspace(header_line[header_line_len-1])) + while(header_line_len && isspace(header_line[header_line_len-1])) header_line[--header_line_len]='\0'; /* new line safety check */