[PATCH] D64507: [BitcodeReader] Validate OpNum, before accessing Record array.

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 10:07:10 PDT 2019


jfb added inline comments.


================
Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4169
+      if (OpNum >= Record.size())
+        return error("Invalid record");
+
----------------
fhahn wrote:
> jfb wrote:
> > Could you provide more info than "invalid record"?
> Sure, although I am not sure what level of detail would be appropriate, as the error itself does not provide any context to the user besides the message.
> 
> How about `Invalid record: operand number exceeded available operands`?
SGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64507/new/

https://reviews.llvm.org/D64507





More information about the llvm-commits mailing list