diff --git a/libcomposefs/lcfs-writer.c b/libcomposefs/lcfs-writer.c index 7c37b7f8..13393c53 100644 --- a/libcomposefs/lcfs-writer.c +++ b/libcomposefs/lcfs-writer.c @@ -856,6 +856,13 @@ int lcfs_node_set_payload(struct lcfs_node_s *node, const char *payload) { char *dup = NULL; if (payload) { + const size_t len = strlen (payload); + size_t limit; + if (S_ISLNK (node->inode.st_mode)) { + limit = PATH_MAX; + } else if (S_ISREG (node->node.st_mode)) { + limit = LCFS_BUILD_INLINE_FILE_SIZE_LIMIT; + } dup = strdup(payload); if (dup == NULL) { errno = ENOMEM;