Hi all, Writing my own LLVM client I've noticed a potential null pointer dereference in EngineBuilder::selectTarget. The class has an optional pointer to the ErrorStr, which can be initialzied through setErrorStr() method. Although, it's strictly optional, selectTarget doesn't verify its value before assignment. Please find patch for branch release_31, revision 155051 attached. - Yury -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120509/c147de15/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: TargetSelect.patch Type: application/octet-stream Size: 488 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120509/c147de15/attachment.obj>
Hi Yury, No need for the "{" "}" since it's a single statement in the compound statement. Other than that minor style detail, this looks fine assuming it applies cleanly to trunk. Do you have commit access? Regards, -Jim On May 9, 2012, at 3:40 PM, Yury Mikhaylov wrote:> Hi all, > > Writing my own LLVM client I've noticed a potential null pointer dereference in EngineBuilder::selectTarget. > > The class has an optional pointer to the ErrorStr, which can be initialzied through setErrorStr() method. Although, it's strictly optional, selectTarget doesn't verify its value before assignment. > > Please find patch for branch release_31, revision 155051 attached. > > - Yury > > <TargetSelect.patch>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Thank you for your response Jim. As of revision 153342 it applies properly to trunk. No, unfortunately I don't have access, would you please commit it for me? Thanks, Yury On Wed, May 9, 2012 at 4:37 PM, Jim Grosbach <grosbach at apple.com> wrote:> Hi Yury, > > No need for the "{" "}" since it's a single statement in the compound > statement. Other than that minor style detail, this looks fine assuming it > applies cleanly to trunk. > > Do you have commit access? > > Regards, > -Jim > > On May 9, 2012, at 3:40 PM, Yury Mikhaylov wrote: > > > Hi all, > > > > Writing my own LLVM client I've noticed a potential null pointer > dereference in EngineBuilder::selectTarget. > > > > The class has an optional pointer to the ErrorStr, which can be > initialzied through setErrorStr() method. Although, it's strictly optional, > selectTarget doesn't verify its value before assignment. > > > > Please find patch for branch release_31, revision 155051 attached. > > > > - Yury > > > > <TargetSelect.patch>_______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120509/f385044f/attachment.html>