Date: Mon, 8 Jun 2009 20:20:22 -0400 From: Glen Barber <glen.j.barber@gmail.com> To: Gary Kline <kline@thought.org> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: flaw found.... Message-ID: <4ad871310906081720p4fcb7c90s3780b230d45c5954@mail.gmail.com> In-Reply-To: <20090609001529.GA7166@thought.org> References: <20090609001529.GA7166@thought.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Gary, On Mon, Jun 8, 2009 at 8:15 PM, Gary Kline<kline@thought.org> wrote: > =A0 =A0 =A0 =A0not surprisingly, i found a fla w in my getc(fp) program t= hat > =A0 =A0 =A0 =A0tried to read past "<?" and "?>" ... =A0the example i adde= d to my > =A0 =A0 =A0 =A0test file was simply the 2 bytes "<" and "?". =A0so if you= have a > =A0 =A0 =A0 =A0stray > > =A0 =A0 =A0 =A0"<?" > > =A0 =A0 =A0 =A0with a matching close case, the binary hangs on a read. > =A0 =A0 =A0 =A0so, again, can anybody suggest a better example, in C, to = get > =A0 =A0 =A0 =A0past two delimiters? > > =A0 =A0 =A0 =A0one thought is how gcc parses the "/*" and "*/" comment > =A0 =A0 =A0 =A0delimiters. =A0any compiler gurus out there who know > =A0 =A0 =A0 =A0where this code is? > > =A0 =A0 =A0 =A0gary > > =A0 =A0 =A0 =A0? > What about having it check a char array, similar to how programs like ls(1) does checking for command line arguments? http://svn.freebsd.org/base/stable/7/bin/ls/ls.c - line 181 and on. --=20 Glen Barber http://www.dev-urandom.com http://www.linkedin.com/in/glenjbarber
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ad871310906081720p4fcb7c90s3780b230d45c5954>