Skip to content

[lib] Fix UBSAN warning in ZSTD_decompressSequences()#2625

Merged
terrelln merged 1 commit intofacebook:devfrom
terrelln:ubsan-failure
May 7, 2021
Merged

[lib] Fix UBSAN warning in ZSTD_decompressSequences()#2625
terrelln merged 1 commit intofacebook:devfrom
terrelln:ubsan-failure

Conversation

@terrelln
Copy link
Contributor

@terrelln terrelln commented May 6, 2021

This moves the pointer addition below the error check, and also moves BIT_reloadDStream() to the bottom of the loop.

Benchmarks run at level 1 on the silesia corpus.

Platform Compiler dev PR
i9-9900k gcc 10.2 1213 MB/s 1207 MB/s
i9-9900k clang 11.1 1032 MB/s 1072 MB/s
Macbook clang 1269 MB/s 1271 MB/s
devserver gcc 840 MB/s 846 MB/s
devserver clang 761 MB/s 780 MB/s

Fixes #2590.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UB in ZSTD_decompressSequences_body when error-valued onSeqSize is added to op

3 participants