mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 00:59:16 +01:00
[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:
1 parent
90417543fd
commit
07c411aff4
1 file changed
+2
-2
+2
-2
@@ -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 ())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user