summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-12-18 13:16:54 +0000
committerAntony Dovgal <tony2001@php.net>2006-12-18 13:16:54 +0000
commit908b1e562d5e2a586ca721e779afedb958d92067 (patch)
tree9d30c84184d05c08e49123d1355cbdac9889c30f /main/SAPI.c
parent9219d7aa57dd88236a9e5d740a1a6d34de097467 (diff)
downloadphp-git-908b1e562d5e2a586ca721e779afedb958d92067.tar.gz
MFH: fix possible invalid read (reproducible only on big-endian machines)
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c2
1 files changed, 1 insertions, 1 deletions
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 */