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>
This commit is contained in:
parent
02f292d905
commit
55a1099603
@ -512,7 +512,7 @@ InetSocketAddress *inet_parse(const char *str, Error **errp)
|
|||||||
{
|
{
|
||||||
InetSocketAddress *addr;
|
InetSocketAddress *addr;
|
||||||
const char *optstr, *h;
|
const char *optstr, *h;
|
||||||
char host[64];
|
char host[65];
|
||||||
char port[33];
|
char port[33];
|
||||||
int to;
|
int to;
|
||||||
int pos;
|
int pos;
|
||||||
|
Loading…
Reference in New Issue
Block a user