Null pointer dereference

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 (488 Bytes)

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?


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?


Done in r156523.

Thanks for the patch!