From patchwork Fri Jan 30 19:37:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 435007 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C7D991401AC for ; Sat, 31 Jan 2015 06:38:32 +1100 (AEDT) Received: from localhost ([::1]:38431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHHOf-0000pG-RP for incoming@patchwork.ozlabs.org; Fri, 30 Jan 2015 14:38:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHHOJ-0000SI-54 for qemu-devel@nongnu.org; Fri, 30 Jan 2015 14:38:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHHOF-0003X2-Pu for qemu-devel@nongnu.org; Fri, 30 Jan 2015 14:38:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHHOF-0003Ve-Iq; Fri, 30 Jan 2015 14:38:03 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0UJc2hY023950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 30 Jan 2015 14:38:02 -0500 Received: from noname.redhat.com (ovpn-116-82.ams2.redhat.com [10.36.116.82]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0UJc06F027300; Fri, 30 Jan 2015 14:38:00 -0500 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Fri, 30 Jan 2015 20:37:55 +0100 Message-Id: <1422646675-17657-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-trivial@nongnu.org Subject: [Qemu-devel] [PATCH] qemu-sockets: Fix buffer overflow in inet_parse() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: John Snow --- 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 a76bb3c..aacf1fc 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;