This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix Scripted ProcessLaunchInfo Argument nullptr deref
ClosedPublic

Authored by mib on Oct 19 2021, 4:17 PM.

Details

Summary

This patch adds a new StructuredData::Dictionary constructor that
takes a StructuredData::ObjectSP as an argument. This is used to pass
the opaque_ptr from the SBStructuredData used to initialize a
ScriptedProcess, to the ProcessLaunchInfo class.

This also updates SBLaunchInfo::SetScriptedProcessDictionary to
reflect the for-mentioned changes which solves the nullptr dereference.

Diff Detail

Event Timeline

mib requested review of this revision.Oct 19 2021, 4:17 PM
mib created this revision.

This LGTM but it would be nice if the commit message could be a bit more specific about the motivation and explain the relationship between an ObjectSP and DictionarySP.

mib updated this revision to Diff 386005.Nov 9 2021, 4:21 PM
mib retitled this revision from [lldb/Plugins] Make `ScriptedInterface::CreatePluginObject` more generic to [lldb] Fix Scripted ProcessLaunchInfo Argument nullptr deref.
mib edited the summary of this revision. (Show Details)

Address @JDevlieghere comments from D112109

JDevlieghere accepted this revision.Nov 9 2021, 10:13 PM

Thanks. This LGTM!

lldb/source/Plugins/Process/scripted/ScriptedProcess.h
36

A shared pointer is default constructed with a nullptr so you can omit that here.

This revision is now accepted and ready to land.Nov 9 2021, 10:13 PM
This revision was landed with ongoing or failed builds.Nov 10 2021, 8:44 AM
This revision was automatically updated to reflect the committed changes.
mib marked an inline comment as done.