[PATCH] D138830: [llvm] Check for overflows when computing load-command's addresses.
Thorsten via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 10:20:00 PST 2022
tschuett added inline comments.
================
Comment at: llvm/lib/Object/MachOObjectFile.cpp:202
+ if (Overflowed ||
+ Ret > reinterpret_cast<long unsigned int>(Obj.getData().end()))
return malformedError("load command " + Twine(LoadCommandIndex) +
----------------
alexander-shaposhnikov wrote:
> nit: I'd probably report a separate message for the overflow case (cause it'd make debugging a tiny bit easier)
nit: could you instead use an integer with a defined bit width: uint64_t?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138830/new/
https://reviews.llvm.org/D138830
More information about the llvm-commits
mailing list