X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Ffile.c;h=084945641346a747ff776e217027f0b08bce0e6b;hp=476f44569a1d99ef93ac5a673eb3efb682f47c59;hb=5a8c8b8bf6e846b8d2d7e710f814d24d9a0183c3;hpb=406dbf7565e702588f172a8cc534acacb2fd7bee diff --git a/daemon/file.c b/daemon/file.c index 476f445..0849456 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -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;