From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5glV-0002TV-N4 for qemu-devel@nongnu.org; Wed, 04 Nov 2009 09:23:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5glP-0002Qe-6t for qemu-devel@nongnu.org; Wed, 04 Nov 2009 09:23:12 -0500 Received: from [199.232.76.173] (port=51010 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5glO-0002Q8-B5 for qemu-devel@nongnu.org; Wed, 04 Nov 2009 09:23:06 -0500 Received: from mail-gx0-f223.google.com ([209.85.217.223]:59317) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5glO-0005q5-3B for qemu-devel@nongnu.org; Wed, 04 Nov 2009 09:23:06 -0500 Received: by gxk23 with SMTP id 23so4558905gxk.2 for ; Wed, 04 Nov 2009 06:23:03 -0800 (PST) Message-ID: <4AF18E45.9070800@codemonkey.ws> Date: Wed, 04 Nov 2009 08:23:01 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/4] Add access control support toqemu-bridge-helper References: <1257294485-27015-1-git-send-email-aliguori@us.ibm.com> <1257294485-27015-3-git-send-email-aliguori@us.ibm.com> <58BD0469C48A7443A479A13D101685E30359C7B6@ala-mail09.corp.ad.wrs.com> In-Reply-To: <58BD0469C48A7443A479A13D101685E30359C7B6@ala-mail09.corp.ad.wrs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Krumme, Chris" Cc: Mark McLoughlin , Arnd Bergmann , Dustin Kirkland , Juan Quintela , qemu-devel@nongnu.org, Michael Tsirkin Krumme, Chris wrote: > Hello Anthony, > > Cool patch series. > Thanks. >> + cmd = ptr; >> + arg = strchr(cmd, ' '); >> + if (arg == NULL) { >> + arg = strchr(cmd, '\t'); >> + } >> + >> + if (arg == NULL) { >> + fprintf(stderr, "Invalid config line:\n %s\n", line); >> + fclose(f); >> + errno = EINVAL; >> + return -1; >> + } >> + >> + *arg = 0; >> > > No check is made for arg being in bounds. > I don't get it. arg is either going to be NULL (no ' ' or '\t' found in the string) or it will point to the first ' ' or '\t' in the string. It will always be in bound in this second case and the first case is handled by the if(). Regards, Anthony Liguori