From: Matthew Daley Date: Tue, 10 Sep 2013 14:34:22 +0000 (+1200) Subject: xenstored: fix possible, but unlikely, stack overflow X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6370^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ba033a204b022cd4a2a8fd2c836d874090cb78e9;p=xen.git xenstored: fix possible, but unlikely, stack overflow ...when reading xenbus port from xenfs. Coverity-ID: 1055741 Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper Acked-by: Ian Jackson --- diff --git a/tools/xenstore/xenstored_linux.c b/tools/xenstore/xenstored_linux.c index 5460ca5573..cf40213b3b 100644 --- a/tools/xenstore/xenstored_linux.c +++ b/tools/xenstore/xenstored_linux.c @@ -32,7 +32,7 @@ evtchn_port_t xenbus_evtchn(void) if (fd == -1) return -1; - rc = read(fd, str, sizeof(str)); + rc = read(fd, str, sizeof(str) - 1); if (rc == -1) { int err = errno;