Skip to content

UndefinedBehaviorSanitizer: invalid left shift in protobuf-c.c:2086 #506

Closed
@pietroborrello

Description

Describe the bug

UndefinedBehaviorSanitizer: invalid left shift in protobuf-c.c:2086

To Reproduce

Built protobuf-c using clang-10 according to the oss-fuzz script with CXXFLAGS='-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: f224ab2

UBSAN Output
$ ./protobuf-c-fuzzer id:000003,sig:06,src:000024,time:945,op:havoc,rep:16,trial:4
INFO: Seed: 1244782513
INFO: Loaded 1 modules   (3433 inline 8-bit counters): 3433 [0x5b06c3, 0x5b142c), 
INFO: Loaded 1 PC tables (3433 PCs): 3433 [0x5587f8,0x565e88), 
protobuf-c-fuzzer: Running 1 inputs 1 time(s) each.
Running: id:000003,sig:06,src:000024,time:945,op:havoc,rep:16,trial:4
protobuf-c/protobuf-c.c:2086:29: runtime error: left shift of 65 by 25 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior protobuf-c/protobuf-c.c:2086:29 in 
Executed id:000003,sig:06,src:000024,time:945,op:havoc,rep:16,trial:4 in 1 ms

testcases that trigger the issue:
protobuf-c.zip

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions