1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-06 16:56:49 +02:00

Work around nullptr-with-nonzero-offset warning

See comment.
This commit is contained in:
Nick Terrell 2023-08-24 16:33:42 -07:00 committed by Nick Terrell
parent 0fcb28c5d2
commit c27fa39904

View File

@ -1548,6 +1548,12 @@ size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)
dctx->stage = ZSTDds_getFrameHeaderSize; dctx->stage = ZSTDds_getFrameHeaderSize;
dctx->processedCSize = 0; dctx->processedCSize = 0;
dctx->decodedSize = 0; dctx->decodedSize = 0;
/* Set to non-null because ZSTD_prefetchMatch() may end up doing addition
* with this value for corrupted frames. However, it then just passes the
* pointer to PREFETCH_L1(), which doesn't require valid pointers. But,
* if it is NULL we get nullptr-with-nonzero-offset UBSAN warnings.
*/
dctx->previousDstEnd = "";
dctx->previousDstEnd = NULL; dctx->previousDstEnd = NULL;
dctx->prefixStart = NULL; dctx->prefixStart = NULL;
dctx->virtualStart = NULL; dctx->virtualStart = NULL;