From 07c411aff453b25473d2dcb66c2d90f424368945 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 1 Nov 2026 13:52:56 -0700 Subject: [PATCH] [repacker] Check visited vector resize result (#6541) update_distances() checked the vector's error state after resize(), but left the return value unchecked, triggering Coverity CID 506917. Check resize() directly and return ALLOCATION_FAILURE on failure. This preserves the existing allocation failure behavior. Tested with meson compile -C build -j 6 and meson test -C build (275 tests passed). Assisted-by: OpenAI Codex --- 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 d944bf357..881329807 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -1871,8 +1871,8 @@ public: TRY (graph_result_t::from (queue, ALLOCATION_FAILURE)); hb_vector_t visited; - visited.resize (vertices_.length); - TRY (graph_result_t::from (visited, ALLOCATION_FAILURE)); + if (unlikely (!visited.resize (vertices_.length))) + return Err(ALLOCATION_FAILURE); while (!queue.in_error () && !queue.is_empty ()) {