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
@@ -233,7 +233,7 @@ static int copy_file_with_version_check(const char *from, const char *to, bool f
if (r < 0)
return r;
if (lseek(fd_from, 0, SEEK_SET) == (off_t) -1)
if (lseek(fd_from, 0, SEEK_SET) < 0)
return log_error_errno(errno, "Failed to seek in \"%s\": %m", from);
fd_to = safe_close(fd_to);