mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
pwrite: Check offset is not negative.
This commit is contained in:
@@ -469,6 +469,11 @@ do_pwrite (const char *path, const char *content, size_t size, int64_t offset)
|
||||
int fd;
|
||||
ssize_t r;
|
||||
|
||||
if (offset < 0) {
|
||||
reply_with_error ("offset is negative");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CHROOT_IN;
|
||||
fd = open (path, O_WRONLY);
|
||||
CHROOT_OUT;
|
||||
|
||||
Reference in New Issue
Block a user