From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVxD5-0007yK-Ux for qemu-devel@nongnu.org; Thu, 12 Mar 2015 03:07:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVxD2-0002OV-Mh for qemu-devel@nongnu.org; Thu, 12 Mar 2015 03:07:11 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:54314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVxD2-0002OL-FH for qemu-devel@nongnu.org; Thu, 12 Mar 2015 03:07:08 -0400 Message-ID: <55013B1B.7040209@msgid.tls.msk.ru> Date: Thu, 12 Mar 2015 10:07:07 +0300 From: Michael Tokarev MIME-Version: 1.0 References: <1426132759-9980-1-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1426132759-9980-1-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vnc: fix segmentation fault when invalid vnc parameters are specified List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: peter.huangpeng@huawei.com, kraxel@redhat.com 12.03.2015 06:59, arei.gonglei@huawei.com wrote: > +++ b/ui/vnc.c > @@ -3698,8 +3698,13 @@ QemuOpts *vnc_parse_func(const char *str) > { > QemuOptsList *olist = qemu_find_opts("vnc"); > QemuOpts *opts = qemu_opts_parse(olist, str, 1); > - const char *id = qemu_opts_id(opts); > + const char *id = NULL; Useless initializer. /mjt > + if (!opts) { > + return NULL; > + } > + > + id = qemu_opts_id(opts);