From 908b1e562d5e2a586ca721e779afedb958d92067 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Mon, 18 Dec 2006 13:16:54 +0000 Subject: [PATCH] MFH: fix possible invalid read (reproducible only on big-endian machines) --- main/SAPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/SAPI.c b/main/SAPI.c index a760ded4a8..5053c621ad 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -565,7 +565,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 */ -- 2.50.1