Skip to content

Commit

Permalink
[fix](json) fix be crash while load json data (#34283) (#34347)
Browse files Browse the repository at this point in the history
  • Loading branch information
cambyzju authored May 6, 2024
1 parent 6c2c493 commit d82ea94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion be/src/vec/exec/format/json/new_json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ Status NewJsonReader::_vhandle_simple_json(std::vector<MutableColumnPtr>& column
objectValue = _json_doc;
}
_next_row = 0;
if (_fuzzy_parse) {
// Here we expect the incoming `objectValue` to be a Json Object, such as {"key" : "value"}
// If a Json Array comes here, it maybe crashed in it->name.GetString()
if (_fuzzy_parse && objectValue->IsObject()) {
for (auto v : slot_descs) {
for (int i = 0; i < objectValue->MemberCount(); ++i) {
auto it = objectValue->MemberBegin() + i;
Expand Down

0 comments on commit d82ea94

Please sign in to comment.