From ba033a204b022cd4a2a8fd2c836d874090cb78e9 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Wed, 11 Sep 2013 02:34:22 +1200 Subject: 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 --- tools/xenstore/xenstored_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/xenstore') 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; -- cgit v1.2.3