qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 19/46] qemu-sockets: Fix buffer overflow in inet_pars


From: Michael Tokarev
Subject: [Qemu-devel] [PULL 19/46] qemu-sockets: Fix buffer overflow in inet_parse()
Date: Tue, 10 Feb 2015 09:34:08 +0300

From: Kevin Wolf <address@hidden>

The size of the stack allocated host[] array didn't account for the
terminating '\0' byte that sscanf() writes. Fix the array size.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
 util/qemu-sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index cf4b91f..61fc3c1 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -512,7 +512,7 @@ InetSocketAddress *inet_parse(const char *str, Error **errp)
 {
     InetSocketAddress *addr;
     const char *optstr, *h;
-    char host[64];
+    char host[65];
     char port[33];
     int to;
     int pos;
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]