From 9dc03f8abc3738f45164a3d31be262fab45cd275 Mon Sep 17 00:00:00 2001 From: Artur Meski Date: Sun, 7 Oct 2018 21:56:48 +0100 Subject: [PATCH] Fixed nullptr deref when there is no state constraint --- symrs.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/symrs.cc b/symrs.cc index 2f2c9aa..a17e661 100644 --- a/symrs.cc +++ b/symrs.cc @@ -947,7 +947,10 @@ void SymRS::encodeCtxAutTrans(void) BDD enc_src = encCtxAutState(t.src_state); BDD enc_dst = encCtxAutStateSucc(t.dst_state); BDD enc_ctx = compContext(encContext(t.ctx)); - BDD enc_drs_state = t.state_constr->getBDDforState(this); + BDD enc_drs_state = BDD_TRUE; + if (t.state_constr != nullptr) { + enc_drs_state = t.state_constr->getBDDforState(this); + } BDD new_trans = enc_src * enc_drs_state * enc_ctx * enc_dst; *tr_ca += new_trans;