qemu-sockets: Fix buffer overflow in inet_parse()

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 <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
master
Kevin Wolf 2015-01-30 20:37:55 +01:00 committed by Michael Tokarev
parent 02f292d905
commit 55a1099603
1 changed files with 1 additions and 1 deletions

View File

@ -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;