From f8bdb584f8552f553c106fc7b32d5129913d8cd0 Mon Sep 17 00:00:00 2001 From: MacDue Date: Fri, 24 Feb 2023 22:50:40 +0000 Subject: [PATCH] LibDeviceTree: Use unchecked_append() in path parsing try_append() checks if the vector should increase capacity and if so grows the vector. unchecked_append() verifies the vector already has enough capacity, and will never grow the vector. --- Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp b/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp index d44f2c958fb..369a714399e 100644 --- a/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp +++ b/Userland/Libraries/LibDeviceTree/FlattenedDeviceTree.cpp @@ -117,7 +117,7 @@ static ErrorOr slow_get_property_raw(StringView name, FlattenedDe return Error::from_errno(ENAMETOOLONG); } // This can never fail as all entries go into the inline buffer, enforced by the check above. - MUST(path.try_append(view)); + path.unchecked_append(view); return {}; }));