diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-10-11 18:38:20 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-10-11 18:38:20 -0700 |
commit | 2edb94a3025d288dc251bc6cbb2c02e60fbd7438 (patch) | |
tree | ce048cfd3d3a2e8025e09c716a7c3edcc8f74b79 /inflate.c | |
parent | e08118c401d5434b7b3a57039263f4fa9b1f7d1a (diff) | |
download | zlib-2edb94a3025d288dc251bc6cbb2c02e60fbd7438.tar.gz zlib-2edb94a3025d288dc251bc6cbb2c02e60fbd7438.tar.bz2 zlib-2edb94a3025d288dc251bc6cbb2c02e60fbd7438.zip |
Avoid casting an out-of-range value to long.
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1526,7 +1526,7 @@ z_streamp strm; | |||
1526 | struct inflate_state FAR *state; | 1526 | struct inflate_state FAR *state; |
1527 | 1527 | ||
1528 | if (strm == Z_NULL || strm->state == Z_NULL) | 1528 | if (strm == Z_NULL || strm->state == Z_NULL) |
1529 | return (long)(((unsigned long)0 - 1) << 16); | 1529 | return -(1L << 16); |
1530 | state = (struct inflate_state FAR *)strm->state; | 1530 | state = (struct inflate_state FAR *)strm->state; |
1531 | return (long)(((unsigned long)((long)state->back)) << 16) + | 1531 | return (long)(((unsigned long)((long)state->back)) << 16) + |
1532 | (state->mode == COPY ? state->length : | 1532 | (state->mode == COPY ? state->length : |