From ef24c4c7502169f016dcd2a26923dbaf3216748c Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 8 Nov 2024 19:37:34 -0800 Subject: [PATCH] Reject invalid MAX_WBITS values at compile time. --- zutil.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zutil.h b/zutil.h index a27430a27..27ca69380 100644 --- a/zutil.h +++ b/zutil.h @@ -65,7 +65,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* To be used only when the state is known to be valid */ /* common constants */ - +#if MAX_WBITS < 9 || MAX_WBITS > 15 +# error MAX_WBITS must be in 9..15 +#endif #ifndef DEF_WBITS # define DEF_WBITS MAX_WBITS #endif