From 588bb236a8fff898ab443dbededb775c3111e950 Mon Sep 17 00:00:00 2001 From: Tim Haines Date: Thu, 5 Dec 2024 10:27:45 -0600 Subject: [PATCH 1/2] Fix possible double-free in aarch64_cft test --- src/instruction/aarch64_cft.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/instruction/aarch64_cft.C b/src/instruction/aarch64_cft.C index 745f3d82..d7fb26f4 100644 --- a/src/instruction/aarch64_cft.C +++ b/src/instruction/aarch64_cft.C @@ -199,7 +199,9 @@ test_results_t aarch64_cft_Mutator::executeTest() logerror("FAILED: instruction %s expected CFT, wasn't present", decodedInsns.front().format().c_str()); retVal = failure_accumulator(retVal, FAILED); } - cfts.pop_front(); + if(!cfts.empty()) { + cfts.pop_front(); + } } decodedInsns.pop_front(); From bdd3c69535b7104e92b9c6a9ddeed79b1b55400c Mon Sep 17 00:00:00 2001 From: Tim Haines Date: Thu, 5 Dec 2024 10:34:56 -0600 Subject: [PATCH 2/2] Also fix for ppc --- src/instruction/power_cft.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/instruction/power_cft.C b/src/instruction/power_cft.C index 612a3a86..9c611941 100644 --- a/src/instruction/power_cft.C +++ b/src/instruction/power_cft.C @@ -180,7 +180,9 @@ test_results_t power_cft_Mutator::executeTest() logerror("FAILED: instruction %s expected CFT, wasn't present", decodedInsns.front().format().c_str()); retVal = failure_accumulator(retVal, FAILED); } - cfts.pop_front(); + if(!cfts.empty()) { + cfts.pop_front(); + } } decodedInsns.pop_front();