detect extraneous bytes in the Sequences section

when nbSeq == 0.

Reported by @ip7z
This commit is contained in:
Yann Collet
2023-06-13 11:43:45 -07:00
parent c8888d9bf4
commit b46236278a
3 changed files with 18 additions and 0 deletions
+2
View File
@@ -720,6 +720,8 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,
if (nbSeq == 0) {
/* No sequence : section ends immediately */
RETURN_ERROR_IF(ip != iend, corruption_detected,
"extraneous data present in the Sequences section");
return (size_t)(ip - istart);
}