git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pwrite: Check offset is not negative.
[libguestfs.git]
/
daemon
/
file.c
diff --git
a/daemon/file.c
b/daemon/file.c
index
476f445
..
0849456
100644
(file)
--- 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;
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;
CHROOT_IN;
fd = open (path, O_WRONLY);
CHROOT_OUT;