[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
This commit is contained in:
Behdad Esfahbod authored and GitHub committed 2026-11-01 13:52:56 -07:00
1 parent 90417543fd
commit 07c411aff4
1 file changed
+2 -2
+2 -2
View File
@@ -1871,8 +1871,8 @@ public:
TRY (graph_result_t<void>::from (queue, ALLOCATION_FAILURE));
hb_vector_t<bool> visited;
visited.resize (vertices_.length);
TRY (graph_result_t<void>::from (visited, ALLOCATION_FAILURE));
if (unlikely (!visited.resize (vertices_.length)))
return Err(ALLOCATION_FAILURE);
while (!queue.in_error () && !queue.is_empty ())
{