diff options
| -rw-r--r-- | gzread.c | 4 | ||||
| -rw-r--r-- | infback.c | 2 | ||||
| -rw-r--r-- | inflate.c | 2 | ||||
| -rw-r--r-- | inftrees.c | 10 |
4 files changed, 10 insertions, 8 deletions
| @@ -267,6 +267,10 @@ local int gz_fetch(gz_statep state) { | |||
| 267 | strm->next_out = state->out; | 267 | strm->next_out = state->out; |
| 268 | if (gz_decomp(state) == -1) | 268 | if (gz_decomp(state) == -1) |
| 269 | return -1; | 269 | return -1; |
| 270 | break; | ||
| 271 | default: | ||
| 272 | gz_error(state, Z_STREAM_ERROR, "state corrupt"); | ||
| 273 | return -1; | ||
| 270 | } | 274 | } |
| 271 | } while (state->x.have == 0 && (!state->eof || strm->avail_in)); | 275 | } while (state->x.have == 0 && (!state->eof || strm->avail_in)); |
| 272 | return 0; | 276 | return 0; |
| @@ -252,7 +252,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, | |||
| 252 | state->last ? " (last)" : "")); | 252 | state->last ? " (last)" : "")); |
| 253 | state->mode = TABLE; | 253 | state->mode = TABLE; |
| 254 | break; | 254 | break; |
| 255 | case 3: | 255 | default: |
| 256 | strm->msg = (z_const char *)"invalid block type"; | 256 | strm->msg = (z_const char *)"invalid block type"; |
| 257 | state->mode = BAD; | 257 | state->mode = BAD; |
| 258 | } | 258 | } |
| @@ -738,7 +738,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) { | |||
| 738 | state->last ? " (last)" : "")); | 738 | state->last ? " (last)" : "")); |
| 739 | state->mode = TABLE; | 739 | state->mode = TABLE; |
| 740 | break; | 740 | break; |
| 741 | case 3: | 741 | default: |
| 742 | strm->msg = (z_const char *)"invalid block type"; | 742 | strm->msg = (z_const char *)"invalid block type"; |
| 743 | state->mode = BAD; | 743 | state->mode = BAD; |
| 744 | } | 744 | } |
| @@ -57,9 +57,9 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, | |||
| 57 | unsigned mask; /* mask for low root bits */ | 57 | unsigned mask; /* mask for low root bits */ |
| 58 | code here; /* table entry for duplication */ | 58 | code here; /* table entry for duplication */ |
| 59 | code FAR *next; /* next available space in table */ | 59 | code FAR *next; /* next available space in table */ |
| 60 | const unsigned short FAR *base; /* base value table to use */ | 60 | const unsigned short FAR *base = NULL; /* base value table to use */ |
| 61 | const unsigned short FAR *extra; /* extra bits table to use */ | 61 | const unsigned short FAR *extra = NULL; /* extra bits table to use */ |
| 62 | unsigned match; /* use base and extra for symbol >= match */ | 62 | unsigned match = 0; /* use base and extra for symbol >= match */ |
| 63 | unsigned short count[MAXBITS+1]; /* number of codes of each length */ | 63 | unsigned short count[MAXBITS+1]; /* number of codes of each length */ |
| 64 | unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ | 64 | unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ |
| 65 | static const unsigned short lbase[31] = { /* Length codes 257..285 base */ | 65 | static const unsigned short lbase[31] = { /* Length codes 257..285 base */ |
| @@ -185,7 +185,6 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, | |||
| 185 | /* set up for code type */ | 185 | /* set up for code type */ |
| 186 | switch (type) { | 186 | switch (type) { |
| 187 | case CODES: | 187 | case CODES: |
| 188 | base = extra = work; /* dummy value--not used */ | ||
| 189 | match = 20; | 188 | match = 20; |
| 190 | break; | 189 | break; |
| 191 | case LENS: | 190 | case LENS: |
| @@ -193,10 +192,9 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, | |||
| 193 | extra = lext; | 192 | extra = lext; |
| 194 | match = 257; | 193 | match = 257; |
| 195 | break; | 194 | break; |
| 196 | default: /* DISTS */ | 195 | case DISTS: |
| 197 | base = dbase; | 196 | base = dbase; |
| 198 | extra = dext; | 197 | extra = dext; |
| 199 | match = 0; | ||
| 200 | } | 198 | } |
| 201 | 199 | ||
| 202 | /* initialize state for loop */ | 200 | /* initialize state for loop */ |
