erofs: fix compression fallback in tarerofs mode
PATCH 1/1 erofs: fix compression fallback in tarerofs mode
The return value of lseek(fd, fpos, SEEK_SET) can overflow the int type. Fix this.
Fixes 376fb2dbe66d ("erofs-utils: lib: introduce diskbuf")
Signed-off-by Gao Xiang <[email protected]>
--- lib/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/inode.c +1 -2
@@ -497,8 +497,7 @@ int erofs_write_file(struct erofs_inode *inode, int fd, u64 fpos)if (!ret || ret != -ENOSPC )return ret; - ret =lseek (fd, fpos,SEEK_SET ); -if (ret <0 ) +if (lseek (fd, fpos,SEEK_SET ) <0 )return -errno; }
Signature · 1 line
2.39.3