From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWTmP-0003Xa-QF for qemu-devel@nongnu.org; Thu, 08 Nov 2012 10:12:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWTmG-0001QQ-C7 for qemu-devel@nongnu.org; Thu, 08 Nov 2012 10:12:29 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:26058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWTmG-0001QJ-7a for qemu-devel@nongnu.org; Thu, 08 Nov 2012 10:12:20 -0500 From: Anthony PERARD Date: Thu, 8 Nov 2012 15:11:41 +0000 Message-ID: <1352387501-21907-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] qemu-sockets: Fix parsing of the inet option 'to'. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel Cc: Anthony PERARD , Paolo Bonzini , Luiz Capitulino Having a qemu command line argument like "-vnc 127.0.0.1:0,to=99" is broken. This have been break with commit 879e45c72da1569e07fbbc6a1aa2a708ea796044. Signed-off-by: Anthony PERARD --- qemu-sockets.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu-sockets.c b/qemu-sockets.c index abcd791..11d3d32 100644 --- a/qemu-sockets.c +++ b/qemu-sockets.c @@ -551,8 +551,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 (1 != sscanf(h, "%d%n", &to, &pos) || + (h[pos] != '\0' && h[pos] != ',')) { error_setg(errp, "error parsing to= argument"); goto fail; } -- Anthony PERARD