From 8b04d886845be5c3b57caae4d96b53133c51ab14 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 25 Jul 2019 22:29:20 +0200 Subject: Fix crash found by afl --- node/scalaroperatornode.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'node/scalaroperatornode.cpp') diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp index 9edbcdc..821150b 100644 --- a/node/scalaroperatornode.cpp +++ b/node/scalaroperatornode.cpp @@ -66,6 +66,13 @@ void ScalarOperatorNode::run(ExecutionNode* previous) m_internalNode->getResult()->setPrevious(previousResult); } + if(internalResult == nullptr) + { + m_errors.insert(Dice::ERROR_CODE::NO_VALID_RESULT, + QObject::tr("No Valid result in arithmetic operatoion: %1").arg(toString(true))); + return; + } + switch(m_arithmeticOperator) { case Die::PLUS: -- cgit v1.2.3-70-g09d2