Commit 28aa746
committed
[lldb-dap] Fix segfault in JSONUtils.cpp when GetUUIDString() returns nullptr
When creating a stack frame in JSONUtils.cpp CreateStackFrame() the code
constructs a std::string from module.GetUUIDString(), which can return
nullptr in some cases (as documented in the implementation of
SBModule::GetUUIDString()). This causes a segmentation fault when passed to
the std::string constructor.
This fix adds a null check before constructing the UUID string, falling back
to an empty string if nullptr is returned. The existing empty check ensures
the moduleId field is omitted from the JSON when no UUID exists.1 parent 58fa7e4 commit 28aa746
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
| 558 | + | |
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
| |||
0 commit comments