LibDeviceTree: Propagate try_append() errors while parsing paths
This commit is contained in:
parent
c56e1c5378
commit
f064f5f36e
Notes:
sideshowbarker
2024-07-16 23:52:10 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/f064f5f36e Pull-request: https://github.com/SerenityOS/serenity/pull/17606 Reviewed-by: https://github.com/ADKaster
1 changed files with 2 additions and 4 deletions
|
@ -113,11 +113,9 @@ static ErrorOr<ReadonlyBytes> slow_get_property_raw(StringView name, FlattenedDe
|
|||
// Name is a path like /path/to/node/property
|
||||
Vector<StringView, 16> path;
|
||||
TRY(name.for_each_split_view('/', SplitBehavior::Nothing, [&path](StringView view) -> ErrorOr<void> {
|
||||
if (path.size() == path.capacity()) {
|
||||
if (path.size() == path.capacity())
|
||||
return Error::from_errno(ENAMETOOLONG);
|
||||
}
|
||||
MUST(path.try_append(view));
|
||||
return {};
|
||||
return path.try_append(view);
|
||||
}));
|
||||
|
||||
bool check_property_name = path.size() == 1; // Properties on root node should be checked immediately
|
||||
|
|
Loading…
Add table
Reference in a new issue