[Lldb-commits] [lldb] 93a5a03 - [lldb] Host::ShellExpandArguments - fix error check for valid dictionary
Simon Pilgrim via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 25 09:44:23 PDT 2022
Author: Simon Pilgrim
Date: 2022-10-25T17:44:04+01:00
New Revision: 93a5a03030ab9f49120f7bd2ec8e84f063da9987
URL: https://github.com/llvm/llvm-project/commit/93a5a03030ab9f49120f7bd2ec8e84f063da9987
DIFF: https://github.com/llvm/llvm-project/commit/93a5a03030ab9f49120f7bd2ec8e84f063da9987.diff
LOG: [lldb] Host::ShellExpandArguments - fix error check for valid dictionary
Fix repeated check for a valid JSON parse and actually check the dictionary pointer
Reported here: https://pvs-studio.com/en/blog/posts/cpp/1003/ (N40)
Added:
Modified:
lldb/source/Host/windows/Host.cpp
Removed:
################################################################################
diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp
index df7859d9b46c9..6908f0003eaf7 100644
--- a/lldb/source/Host/windows/Host.cpp
+++ b/lldb/source/Host/windows/Host.cpp
@@ -245,7 +245,7 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
}
auto dict_sp = data_sp->GetAsDictionary();
- if (!data_sp) {
+ if (!dict_sp) {
error.SetErrorString("invalid JSON");
return error;
}
More information about the lldb-commits
mailing list