提交 1ccbc285 编写于 作者: A Anthony PERARD 提交者: malc

qemu-sockets: Fix parsing of the inet option 'to'.

Having a qemu command line argument like "-vnc 127.0.0.1:0,to=99" is broken.
This have been break with commit 879e45c7.
Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Nmalc <av1474@comtv.ru>
上级 ecf51c9a
......@@ -529,8 +529,9 @@ static InetSocketAddress *inet_parse(const char *str, Error **errp)
optstr = str + pos;
h = strstr(optstr, ",to=");
if (h) {
if (1 != sscanf(str, "%d%n", &to, &pos) ||
(str[pos] != '\0' && str[pos] != ',')) {
h += 4;
if (sscanf(h, "%d%n", &to, &pos) != 1 ||
(h[pos] != '\0' && h[pos] != ',')) {
error_setg(errp, "error parsing to= argument");
goto fail;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册