diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-12-15 02:31:26 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-12-15 02:31:54 +0100 |
commit | a8ae870667efc4051acdc323dc2a27293c82f600 (patch) | |
tree | 7be90edb0072b13895fc79244bb2e9a0bdbd3d69 /tar | |
parent | 724524cd401325120de9d96e6a1023c3561c8879 (diff) |
Clamp mtime in tar2sqfs to the representable 32 bit range.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tar')
-rw-r--r-- | tar/tar2sqfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c index 6be682f..cca604a 100644 --- a/tar/tar2sqfs.c +++ b/tar/tar2sqfs.c @@ -423,6 +423,14 @@ static int process_tar_ball(void) if (ret < 0) return -1; + if (hdr.mtime < 0) + hdr.mtime = 0; + + if ((sqfs_u64)hdr.mtime > 0x0FFFFFFFFUL) + hdr.mtime = 0x0FFFFFFFFUL; + + hdr.sb.st_mtime = hdr.mtime; + skip = false; is_root = false; is_prefixed = true; |