summary refs log tree commit diff stats
path: root/fsdev/virtfs-proxy-helper.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-08 12:38:43 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-08 12:38:43 +0000
commitf53f3d0a00b6df39ce8dfca942608e5b6a9a4f71 (patch)
tree1fda6a6482b69da84db90e151c3250a7fd9c7482 /fsdev/virtfs-proxy-helper.c
parentd7c698af8a5c7330a5ba70de0ff70904a661c20e (diff)
parent993c91a0e996346c7ee8fa2ca310cc76edb59e17 (diff)
downloadfocaccia-qemu-f53f3d0a00b6df39ce8dfca942608e5b6a9a4f71.tar.gz
focaccia-qemu-f53f3d0a00b6df39ce8dfca942608e5b6a9a4f71.zip
Merge remote-tracking branch 'remotes/kvaneesh/for-upstream' into staging
* remotes/kvaneesh/for-upstream:
  hw/9pfs: Include virtio-9p-device.o in build
  hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation
  hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()
  hw/9pfs/virtio-9p-local.c: move v9fs_string_free() to below "err_out:"
  fsdev: Fix overrun after readlink() fills buffer completely

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'fsdev/virtfs-proxy-helper.c')
-rw-r--r--fsdev/virtfs-proxy-helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 713a7b2b87..bfecb8706c 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -595,7 +595,7 @@ static int do_readlink(struct iovec *iovec, struct iovec *out_iovec)
     }
     buffer = g_malloc(size);
     v9fs_string_init(&target);
-    retval = readlink(path.data, buffer, size);
+    retval = readlink(path.data, buffer, size - 1);
     if (retval > 0) {
         buffer[retval] = '\0';
         v9fs_string_sprintf(&target, "%s", buffer);