]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Correct deflate header detection
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Apr 2020 14:41:28 +0000 (15:41 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Apr 2020 14:41:28 +0000 (15:41 +0100)
src/lua/lua_util.c

index d89cfd28d2cfe4861b2946cf5f8a9f2e2e529a9d..04413f2f65b7fe8bc1feec2b9fd154beb19776d1 100644 (file)
@@ -2392,7 +2392,7 @@ lua_util_zlib_inflate (lua_State *L, int windowBits)
 
        /* Here are dragons to distinguish between raw deflate and zlib */
        if (windowBits == MAX_WBITS && t->len > 0) {
-               if ((int)(unsigned char)t->start[0] != 0x78) {
+               if ((int)(unsigned char)((t->start[0] << 4)) != 0x80) {
                        /* Assume raw deflate */
                        windowBits = -windowBits;
                }