]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix legacy decoders v0.4, v0.5 and v0.6
authorYann Collet <yann.collet.73@gmail.com>
Tue, 7 Feb 2023 22:02:12 +0000 (14:02 -0800)
committerYann Collet <yann.collet.73@gmail.com>
Tue, 7 Feb 2023 22:02:12 +0000 (14:02 -0800)
lib/legacy/zstd_v04.c
lib/legacy/zstd_v05.c
lib/legacy/zstd_v06.c

index f820134b7cbe74edc576bc1af2b9d62c3cc81002..57be832bd32f4cede8eaaffd64318c02980db97c 100644 (file)
@@ -2835,7 +2835,6 @@ static size_t ZSTD_execSequence(BYTE* op,
     if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
     /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
     if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
-    if (sequence.offset > (U32)(oLitEnd - base)) return ERROR(corruption_detected);
 
     if (oMatchEnd > oend) return ERROR(dstSize_tooSmall);   /* overwrite beyond dst buffer */
     if (litEnd > litLimit) return ERROR(corruption_detected);   /* overRead beyond lit buffer */
index 85c4ce79fed68cbd702f41bd6b4c735fcf369a68..93a1169f3b61cbd24131689d4fa1a1c406430513 100644 (file)
@@ -3189,7 +3189,6 @@ static size_t ZSTDv05_execSequence(BYTE* op,
     if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
     /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
     if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
-    if (sequence.offset > (U32)(oLitEnd - base)) return ERROR(corruption_detected);
 
     if (oMatchEnd > oend) return ERROR(dstSize_tooSmall);   /* overwrite beyond dst buffer */
     if (litEnd > litLimit) return ERROR(corruption_detected);   /* overRead beyond lit buffer */
index 097182a4c70d2accc7b0be94f8671cfdb0bed503..175f7cc4224eb85dc3ba6bb33d1f8a0d3c4f39b1 100644 (file)
@@ -3329,7 +3329,6 @@ static size_t ZSTDv06_execSequence(BYTE* op,
     if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
     /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
     if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
-    if (sequence.offset > (U32)(oLitEnd - base)) return ERROR(corruption_detected);
 
     if (oMatchEnd > oend) return ERROR(dstSize_tooSmall);   /* overwrite beyond dst buffer */
     if (iLitEnd > litLimit) return ERROR(corruption_detected);   /* overRead beyond lit buffer */