mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
MFH: fix possible invalid read (reproducible only on big-endian machines)
This commit is contained in:
parent
9219d7aa57
commit
908b1e562d
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user