From: Nikita Popov Date: Wed, 19 Jun 2019 13:06:48 +0000 (+0200) Subject: Fix shift UB in gd_io.c X-Git-Tag: php-7.4.0alpha2~51^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea97fc9c1f78c24b59031d8377461976d281972c;p=php Fix shift UB in gd_io.c This has already been fixed upstream in https://github.com/libgd/libgd/commit/24d352576c024769d18113a28f3be03d54fa1e66 and https://github.com/libgd/libgd/commit/772d0107a6b00a0d6d7191383fe984f8c018b48c. --- diff --git a/ext/gd/libgd/gd_io.c b/ext/gd/libgd/gd_io.c index 9b5cc0c7dd..1ca822fc9b 100644 --- a/ext/gd/libgd/gd_io.c +++ b/ext/gd/libgd/gd_io.c @@ -117,7 +117,7 @@ int gdGetWordLSB(signed short int *result, gdIOCtx *ctx) int gdGetInt (int *result, gdIOCtx * ctx) { - int r; + unsigned int r; r = (ctx->getC) (ctx); GD_IO_EOF_CHK(r); *result = r << 24; @@ -141,7 +141,7 @@ int gdGetInt (int *result, gdIOCtx * ctx) int gdGetIntLSB(signed int *result, gdIOCtx *ctx) { - int c = 0; + unsigned int c; unsigned int r = 0; c = (ctx->getC) (ctx);