Skip to content

Commit

Permalink
Avoid casting an out-of-range value to long.
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Oct 12, 2016
1 parent e08118c commit 2edb94a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ z_streamp strm;
struct inflate_state FAR *state;

if (strm == Z_NULL || strm->state == Z_NULL)
return (long)(((unsigned long)0 - 1) << 16);
return -(1L << 16);
state = (struct inflate_state FAR *)strm->state;
return (long)(((unsigned long)((long)state->back)) << 16) +
(state->mode == COPY ? state->length :
Expand Down

0 comments on commit 2edb94a

Please sign in to comment.