Prevent possible integer overflow

This commit is contained in:
Dmitry Stogov 2011-11-02 08:07:12 +00:00
parent c2874a8077
commit fbdd2f3e5e

View File

@ -1383,7 +1383,7 @@ static int get_http_body(php_stream *stream, int close, char *headers, char **r
}
} else if (header_length) {
if (header_length < 0) {
if (header_length < 0 || header_length >= INT_MAX) {
return FALSE;
}
http_buf = safe_emalloc(1, header_length, 1);