From 7d8e61f4a6d99d4123a3a0f1582c5bb220fc85bb Mon Sep 17 00:00:00 2001 From: takubokudori Date: Thu, 9 Mar 2023 14:07:25 +0900 Subject: [PATCH] Fix enumeration gadgets with unique option (#51) --- src/rp/toolbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rp/toolbox.cpp b/src/rp/toolbox.cpp index cb11352..b6c7b03 100644 --- a/src/rp/toolbox.cpp +++ b/src/rp/toolbox.cpp @@ -104,7 +104,7 @@ std::vector string_to_hex(const std::string &hex) { GadgetSet only_unique_gadgets(GadgetMultiset &list_gadgets) { GadgetSet unique_gadgets; // Now we have a list of gadget, cool, but we want to keep only the unique! - for (size_t i = 0; i < list_gadgets.size(); i++) { + while (!list_gadgets.empty()) { auto node = list_gadgets.extract(list_gadgets.begin()); const uint64_t first_offset = node.value().get_first_offset(); const uint64_t first_va_section = node.value().get_first_va_section();