From bb1f53c2540a1e45c18eb8fbe4935b9c4e4fefa8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Jul 2023 13:29:56 -0600 Subject: [PATCH] [graph] Try fixing infinite loop found by CIFuzz under malloc fail --- src/graph/graph.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graph/graph.hh b/src/graph/graph.hh index 8681de365..6c2b8b2db 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -211,8 +211,8 @@ struct graph_t single_parent = (unsigned) -1; } - incoming_edges_++; - parents.set (parent_index, parents[parent_index] + 1); + if (parents.set (parent_index, parents[parent_index] + 1)) + incoming_edges_++; } void remove_parent (unsigned parent_index)