Skip to content

Commit

Permalink
Merge pull request #232 from cgwalters/xattr-limits
Browse files Browse the repository at this point in the history
writer: Limit to UINT16_MAX xattrs
  • Loading branch information
alexlarsson authored Dec 5, 2023
2 parents 9a9cd59 + 4af1eae commit 38564f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,11 @@ int lcfs_node_set_xattr(struct lcfs_node_s *node, const char *name,
return 0;
}

if (node->n_xattrs == UINT16_MAX) {
errno = EINVAL;
return -1;
}

xattrs = realloc(node->xattrs,
(node->n_xattrs + 1) * sizeof(struct lcfs_xattr_s));
if (xattrs == NULL) {
Expand Down

0 comments on commit 38564f4

Please sign in to comment.