From: George Peter Banyard Date: Wed, 5 Feb 2020 17:10:09 +0000 (+0100) Subject: Fix false positive for -Wtype-limits in standard image ext X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78f9f5e44f3facfdc1f24e02cc5eab24196381fe;p=php Fix false positive for -Wtype-limits in standard image ext --- diff --git a/ext/standard/image.c b/ext/standard/image.c index f4d93d3f77..e7bc509e91 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -436,7 +436,7 @@ static int php_skip_variable(php_stream * stream) */ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info) { - unsigned short length; + size_t length; char *buffer; char markername[16]; zval *tmp; @@ -447,7 +447,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info) } length -= 2; /* length includes itself */ - buffer = emalloc((size_t)length); + buffer = emalloc(length); if (php_stream_read(stream, buffer, (size_t) length) != length) { efree(buffer);