Merge pull request #29601 from yuwata/mmap-check-overflow

mmap: check offset and size more carefully
This commit is contained in:
Luca Boccassi
2023-10-24 12:20:04 +01:00
committed by GitHub
27 changed files with 365 additions and 82 deletions
+1 -1
View File
@@ -284,7 +284,7 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
return -EIO;
}
if (lseek(fd, n, SEEK_CUR) == (off_t) -1)
if (lseek(fd, n, SEEK_CUR) < 0)
return -errno;
q += n;