[PATCH] D138830: [llvm] Check for overflows when computing load-command's addresses.

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 10:02:02 PST 2022


alexander-shaposhnikov 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) +
----------------
nit: I'd probably report a separate message for the overflow case (cause it'd make debugging a tiny bit easier)


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