Skip to content

Commit

Permalink
Fix extra field processing bug that dereferences NULL state->head.
Browse files Browse the repository at this point in the history
The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.
  • Loading branch information
Mark Adler committed Aug 8, 2022
1 parent 22aec0c commit 1eb7682
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,10 @@ int flush;
copy = state->length;
if (copy > have) copy = have;
if (copy) {
len = state->head->extra_len - state->length;
if (state->head != Z_NULL &&
state->head->extra != Z_NULL &&
len < state->head->extra_max) {
(len = state->head->extra_len - state->length) <
state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
Expand Down

0 comments on commit 1eb7682

Please sign in to comment.