git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
406dbf7
)
pwrite: Check offset is not negative.
author
Richard W.M. Jones
<rjones@redhat.com>
Sun, 26 Sep 2010 16:59:50 +0000
(17:59 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Sun, 26 Sep 2010 21:21:36 +0000
(22:21 +0100)
daemon/file.c
patch
|
blob
|
history
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;
+ if (offset < 0) {
+ reply_with_error ("offset is negative");
+ return -1;
+ }
+
CHROOT_IN;
fd = open (path, O_WRONLY);
CHROOT_OUT;