Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkcomposefs: Handle NULL from strndup() #246

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ static struct lcfs_node_s *lookup_parent_path(struct lcfs_node_s *node,
}

cleanup_free char *name = strndup(start, path - start);
if (name == NULL)
oom();

struct lcfs_node_s *child = lcfs_node_lookup_child(node, name);
if (child == NULL)
Expand All @@ -233,6 +235,8 @@ static struct lcfs_node_s *lookup_path(struct lcfs_node_s *node, const char *pat
path++;

cleanup_free char *name = strndup(start, path - start);
if (name == NULL)
oom();

struct lcfs_node_s *child = lcfs_node_lookup_child(node, name);
if (child == NULL)
Expand Down
Loading