mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
[lldb][lldb-vscode] Fix nullptr dereference when JSON is not an object
Reviewed By: wallace Differential Revision: https://reviews.llvm.org/D156977
This commit is contained in:
parent
62ea799e6c
commit
bdeb35bda4
@ -523,12 +523,13 @@ PacketStatus VSCode::GetNextObject(llvm::json::Object &object) {
|
||||
}
|
||||
return PacketStatus::JSONMalformed;
|
||||
}
|
||||
object = *json_value->getAsObject();
|
||||
if (!json_value->getAsObject()) {
|
||||
llvm::json::Object *object_ptr = json_value->getAsObject();
|
||||
if (!object_ptr) {
|
||||
if (log)
|
||||
*log << "error: json packet isn't a object" << std::endl;
|
||||
return PacketStatus::JSONNotObject;
|
||||
}
|
||||
object = *object_ptr;
|
||||
return PacketStatus::Success;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user