Skip to content

Commit ea97fc9

Browse files
committed
Fix shift UB in gd_io.c
This has already been fixed upstream in libgd/libgd@24d3525 and libgd/libgd@772d010.
1 parent 1c018af commit ea97fc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/gd/libgd/gd_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int gdGetWordLSB(signed short int *result, gdIOCtx *ctx)
117117

118118
int gdGetInt (int *result, gdIOCtx * ctx)
119119
{
120-
int r;
120+
unsigned int r;
121121
r = (ctx->getC) (ctx);
122122
GD_IO_EOF_CHK(r);
123123
*result = r << 24;
@@ -141,7 +141,7 @@ int gdGetInt (int *result, gdIOCtx * ctx)
141141

142142
int gdGetIntLSB(signed int *result, gdIOCtx *ctx)
143143
{
144-
int c = 0;
144+
unsigned int c;
145145
unsigned int r = 0;
146146

147147
c = (ctx->getC) (ctx);

0 commit comments

Comments
 (0)