]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed uninitialization error, reported by Maciej Adamczyk
authorYann Collet <yann.collet.73@gmail.com>
Mon, 11 Apr 2016 12:10:23 +0000 (14:10 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Mon, 11 Apr 2016 12:10:23 +0000 (14:10 +0200)
lib/zstd_decompress.c

index 94caa09049b92de0bd7bec30c110e9f4fa0e1dfb..c4e4573483db587d80cbeffbc298418baeeac04c 100644 (file)
@@ -482,6 +482,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
                 break;
             case 3:
                 litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
+                if (srcSize<4) return ERROR(corruption_detected);
                 break;
             }
             if (litSize > ZSTD_BLOCKSIZE_MAX) return ERROR(corruption_detected);