Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UndefinedBehaviorSanitizer: invalid shifts #224

pietroborrello opened this issue May 4, 2022 · 0 comments

UndefinedBehaviorSanitizer: invalid shifts #224

pietroborrello opened this issue May 4, 2022 · 0 comments


Copy link

@pietroborrello pietroborrello commented May 4, 2022

Describe the bug

UndefinedBehaviorSanitizer: two runtime errors that expose invalid integer shifts in the library.

To Reproduce

Built lrzip using clang-10 with CXXFLAGS and/or CFLAGS ='-O1 -fsanitize=address -fsanitize=array-bounds,bool,builtin,enum,float-divide-by-zero,function,integer-divide-by-zero,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr'

commit: 3495188

UBSAN Output
$ ./lrzip -d ./id:000000,sig:06,src:000057+000060,time:234495,op:splice,rep:8,trial:0 -o asd
Output filename is: asd
lrzip.c:208:36: runtime error: left shift of 2149580800 by 32 places cannot be represented in type 'i64' (aka 'long')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lrzip.c:208:36 in 
Invalid expected size -9214364837600034554

$ ./lrzip -d ../../fizzbench-second-bench/cve-unique/lrzip-lrzip_decompress_fuzzer/id:000001,sig:06,src:000124+000094,time:315933,op:splice,rep:2,trial:3 -o output
Output filename is: output
libzpaq/libzpaq.cpp:804:58: runtime error: left shift of negative value -70
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libzpaq/libzpaq.cpp:804:58 in 


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

No branches or pull requests

1 participant