Fix a bug when getting a gzip header extra field with inflate() (#2471)
This commit is contained in:
parent
c4852a7104
commit
b15cf9dfa4
5
extern/zlib/inflate.c
vendored
5
extern/zlib/inflate.c
vendored
|
@ -758,9 +758,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_len - state->length;
|
||||
state->head->extra != Z_NULL &&
|
||||
len < state->head->extra_max) {
|
||||
zmemcpy(state->head->extra + len, next,
|
||||
len + copy > state->head->extra_max ?
|
||||
state->head->extra_max - len : copy);
|
||||
|
|
Loading…
Reference in a new issue