• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff -Npur zlib-1.2.11/inflate.c zlib-1.2.11-change/inflate.c
2--- zlib-1.2.11/inflate.c	2017-01-01 15:37:10.000000000 +0800
3+++ zlib-1.2.11-change/inflate.c	2022-08-17 06:25:06.033176873 +0800
4@@ -759,8 +759,9 @@ int flush;
5                 if (copy > have) copy = have;
6                 if (copy) {
7                     if (state->head != Z_NULL &&
8-                        state->head->extra != Z_NULL) {
9-                        len = state->head->extra_len - state->length;
10+                        state->head->extra != Z_NULL &&
11+                        (len = state->head->extra_len - state->length) <
12+                        state->head->extra_max) {
13                         zmemcpy(state->head->extra + len, next,
14                                 len + copy > state->head->extra_max ?
15                                 state->head->extra_max - len : copy);
16