From: Anton Blanchard Date: Sun, 5 Jul 2015 23:41:09 +0000 (+1000) Subject: http parser code assumes char is signed X-Git-Tag: php-7.0.0beta1~12^2~45^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=275009d0bdece1cd9fe58ca34d1ab7586441ec30;p=php http parser code assumes char is signed A char can be either signed or unsigned, and on PowerPC and ARM it is unsigned. The following code will always be false on these architectures: if (c == -1) goto error; --- diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c index d289e80f70..aa9f28638f 100644 --- a/sapi/cli/php_http_parser.c +++ b/sapi/cli/php_http_parser.c @@ -326,7 +326,8 @@ size_t php_http_parser_execute (php_http_parser *parser, const char *data, size_t len) { - char c, ch; + char ch; + signed char c; const char *p = data, *pe; size_t to_read;