]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Always check that distance is too far back in inflateBack.
authorMika T. Lindqvist <postmaster@raasu.org>
Tue, 19 May 2026 13:06:46 +0000 (16:06 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 28 May 2026 20:02:45 +0000 (22:02 +0200)
infback.c

index c4d6214faf1179342deb843d85c5bbb98c187319..a43a8199c04dc5214d77754d8f8b1f634b4d43cc 100644 (file)
--- a/infback.c
+++ b/infback.c
@@ -460,12 +460,10 @@ int32_t Z_EXPORT PREFIX(inflateBack)(PREFIX3(stream) *strm, in_func in, void *in
                 state->offset += BITS(state->extra);
                 DROPBITS(state->extra);
             }
-#ifdef INFLATE_STRICT
             if (state->offset > state->wsize - (state->whave < state->wsize ? left : 0)) {
                 SET_BAD("invalid distance too far back");
                 break;
             }
-#endif
             TRACE_DISTANCE(state->offset);
 
             /* copy match from window to output */