]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed load of misaligned address in deflate_quick.c. zlib-ng/zlib-ng#453
authorNathan Moinvaziri <nathan@solidstatenetworks.com>
Sun, 20 Oct 2019 21:40:42 +0000 (14:40 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 22 Oct 2019 07:58:46 +0000 (09:58 +0200)
arch/x86/deflate_quick.c

index b60fc04f21f0f89fd4b3968c2d67704baf2eb655..3fa4f187e30a76cb15f824424b8f0e25b6a8deb7 100644 (file)
@@ -62,7 +62,7 @@ static inline long compare258(const unsigned char *const src0, const unsigned ch
         cnt += 16;
     } while (cnt < 256);
 
-    if (*(unsigned short *)(src0 + cnt) == *(unsigned short *)(src1 + cnt)) {
+    if (memcmp(src0 + cnt, src1 + cnt, sizeof(uint16_t)) == 0) {
         cnt += 2;
     } else if (*(src0 + cnt) == *(src1 + cnt)) {
         cnt++;