]> granicus.if.org Git - llvm/commit
[Bitcode] Fix an unsigned integer overflow while parsing bitcode wrapper header
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sun, 8 May 2016 21:27:39 +0000 (21:27 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sun, 8 May 2016 21:27:39 +0000 (21:27 +0000)
commit2b1f6c23bcbd88f5e7a3d6659446e45c9592cedf
tree65354c80b70b97dd8cc05f362a7a2d5288775033
parentba458cf29fa616520132a3caad3b83495c868681
[Bitcode] Fix an unsigned integer overflow while parsing bitcode wrapper header

Specially crafted bitcode wrapper headers can cause unsigned interger
overflow and lead to crashes when wrapping around. Fix the offset check
and avoid such scenarios.

Writing a testcase for this would involve editing the binary to generate
values that trigger the overflow, since this would never happen while
generating the bitcode in regular compilation flows, so there's
currently no feasible way add one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268881 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/ReaderWriter.h