diff --git a/.github/workflows/dev-long-tests.yml b/.github/workflows/dev-long-tests.yml index e2081ee46a..2f2793bcd0 100644 --- a/.github/workflows/dev-long-tests.yml +++ b/.github/workflows/dev-long-tests.yml @@ -15,7 +15,7 @@ jobs: make-all: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: make all run: make all @@ -26,7 +26,7 @@ jobs: DEVNULLRIGHTS: 1 READFROMBLOCKDEVICE: 1 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: make test run: make test @@ -34,7 +34,7 @@ jobs: make-test-osx: runs-on: macos-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: OS-X test run: make test # make -c lib all doesn't work because of the fact that it's not a tty @@ -45,7 +45,7 @@ jobs: DEVNULLRIGHTS: 1 READFROMBLOCKDEVICE: 1 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: make test run: | sudo apt-get -qqq update @@ -55,21 +55,21 @@ jobs: no-intrinsics-fuzztest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: no intrinsics fuzztest run: MOREFLAGS="-DZSTD_NO_INTRINSICS" make -C tests fuzztest tsan-zstreamtest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: thread sanitizer zstreamtest run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream ubsan-zstreamtest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: undefined behavior sanitizer zstreamtest run: CC=clang make uasan-test-zstream @@ -77,7 +77,7 @@ jobs: tsan-fuzztest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: thread sanitizer fuzztest run: CC=clang make tsan-fuzztest @@ -85,7 +85,7 @@ jobs: big-tests-zstreamtest32: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: zstream tests in 32bit mode, with big tests run: | sudo apt-get -qqq update @@ -96,7 +96,7 @@ jobs: gcc-8-asan-ubsan-testzstd: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: gcc-8 + ASan + UBSan + Test Zstd # See https://askubuntu.com/a/1428822 run: | @@ -108,14 +108,14 @@ jobs: clang-asan-ubsan-testzstd: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # tag=v3 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # tag=v3 - name: clang + ASan + UBSan + Test Zstd run: CC=clang make -j uasan-test-zstd isFrameDecompression || streaming == not_streaming); assert(expectedWriteSize <= blockSizeMax); - if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) { + if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH && litSize > 0) { /* If we aren't streaming, we can just put the literals after the output * of the current block. We don't need to worry about overwriting the * extDict of our window, because it doesn't exist. @@ -101,6 +101,7 @@ static void ZSTD_allocateLiteralsBuffer(ZSTD_DCtx* dctx, void* const dst, const dctx->litBufferEnd = dctx->litBuffer + litSize; dctx->litBufferLocation = ZSTD_not_in_dst; } else { + assert(litSize > 0); assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE); /* Literals must be split between the output block and the extra lit * buffer. We fill the extra lit buffer with the tail of the literals, @@ -191,6 +192,7 @@ static size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, ""); RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, ""); ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0); + assert(dctx->litBuffer != NULL); /* prefetch huffman table if cold */ if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {