Check st.st_size (off_t) for actual file size instead of the possibly
already truncated entry->size (unsigned int) value. Otherwise files
larger than 4 GB might be silently truncated.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
entry->size = parse_directory(root_entry, path, &entry->child, fslen_ub);
} else if (S_ISREG(st.st_mode)) {
entry->path = xstrdup(path);
- if (entry->size >= (1 << CRAMFS_SIZE_WIDTH)) {
+ if (st.st_size >= (1 << CRAMFS_SIZE_WIDTH)) {
warn_size = 1;
entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1;
}