Hello Anthony, > -----Original Message----- > From: Anthony Liguori [mailto:anth...@codemonkey.ws] > Sent: Wednesday, November 04, 2009 8:23 AM > To: Krumme, Chris > Cc: qemu-devel@nongnu.org; Mark McLoughlin; Arnd Bergmann; > Michael Tsirkin; Juan Quintela; Dustin Kirkland > Subject: Re: [Qemu-devel] [PATCH 2/4] Add access control > support toqemu-bridge-helper > > 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
My concern is that the first space or tab may not be in the first sizeof(line) characters. Thanks Chris > will always be in bound in this second case and the first case is > handled by the if(). > > Regards, > > Anthony Liguori >