From 4551a1ad51ab9bffc309166f83169457f4bfec66 Mon Sep 17 00:00:00 2001 From: howsohazard <143410553+howsohazard@users.noreply.github.com> Date: Sun, 4 Aug 2024 20:37:51 -0400 Subject: [PATCH] 21135: Fixes possible crash when merging nullptr with a null EvaluableNode (#209) --- .../evaluablenode/EvaluableNodeTreeManipulation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp b/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp index 372cb9b6..ddbdf578 100644 --- a/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp +++ b/src/Amalgam/evaluablenode/EvaluableNodeTreeManipulation.cpp @@ -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();