MFH: fix possible invalid read (reproducible only on big-endian machines)

This commit is contained in:
Antony Dovgal 2006-12-18 13:16:54 +00:00
parent 9219d7aa57
commit 908b1e562d

View File

@ -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 */