This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix overflow for input without version
ClosedPublic

Authored by JDevlieghere on Aug 23 2017, 9:14 AM.

Details

Summary

ASAN detected a heap buffer overflow in the WasmObjectFile ctor when reading an file with a missing or incomplete version number.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Aug 23 2017, 9:14 AM
dschuff accepted this revision.Aug 23 2017, 9:19 AM

Thanks!

This revision is now accepted and ready to land.Aug 23 2017, 9:19 AM
sbc100 accepted this revision.Aug 23 2017, 11:53 AM

Thanks! I should really have included better handling of EOF in general within this file.

JDevlieghere updated this revision to Diff 112425.EditedAug 23 2017, 12:52 PM

Running the tests identified an off-by-one error: must be > rather than >=

This revision was automatically updated to reflect the committed changes.