Skip to content

Commit

Permalink
21135: Fixes possible crash when merging nullptr with a null Evaluabl…
Browse files Browse the repository at this point in the history
…eNode (#209)
  • Loading branch information
howsohazard authored Aug 5, 2024
1 parent f32e43b commit 4551a1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ EvaluableNode *EvaluableNodeTreeManipulation::CreateGeneralizedNode(NodesMergeMe
else if(DoesEvaluableNodeTypeUseStringData(common_type))
n->SetStringID(node->GetStringID());

//if either is a null, then handle logic below by creating a null EvaluableNode
EvaluableNode null_merge_node(ENT_NULL);
if(n1 == nullptr)
n1 = &null_merge_node;
if(n2 == nullptr)
n2 = &null_merge_node;

//merge labels
size_t n1_num_labels = n1->GetNumLabels();
size_t n2_num_labels = n2->GetNumLabels();
Expand Down

0 comments on commit 4551a1a

Please sign in to comment.