diff --git a/src/graph/graph.hh b/src/graph/graph.hh index e26f7d79d..38ca5db09 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -700,6 +700,9 @@ struct graph_t } } + if (in_error ()) + return false; + if (!made_changes) return false; @@ -833,7 +836,11 @@ struct graph_t if (index_map.has (node_idx)) return; - index_map.set (node_idx, duplicate (node_idx)); + unsigned clone_idx = duplicate (node_idx); + if (!check_success (clone_idx != (unsigned) -1)) + return; + + index_map.set (node_idx, clone_idx); for (const auto& l : object (node_idx).all_links ()) { duplicate_subgraph (l.objidx, index_map); } diff --git a/test/fuzzing/graphs/clusterfuzz-testcase-minimized-hb-repacker-fuzzer-5475787333828608 b/test/fuzzing/graphs/clusterfuzz-testcase-minimized-hb-repacker-fuzzer-5475787333828608 new file mode 100644 index 000000000..af2a8506d Binary files /dev/null and b/test/fuzzing/graphs/clusterfuzz-testcase-minimized-hb-repacker-fuzzer-5475787333828608 differ