[PATCH] D37439: [MachO] Prevent heap overflow when load command extends past EOF
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 12 08:46:43 PDT 2017
aprantl added inline comments.
================
Comment at: lib/Object/MachOObjectFile.cpp:186
if (auto CmdOrErr = getStructOrErr<MachO::load_command>(Obj, Ptr)) {
+ if (CmdOrErr->cmdsize + Ptr > Obj.getData().end())
+ return malformedError("load command " + Twine(LoadCommandIndex) +
----------------
What happens on a 32-bit platform when cmdsize is so large that the addition wraps around? Or is cmdsize < 32bit ?
Repository:
rL LLVM
https://reviews.llvm.org/D37439
More information about the llvm-commits
mailing list