flaw found....

Glen Barber glen.j.barber at gmail.com
Tue Jun 9 00:20:25 UTC 2009


Gary,

On Mon, Jun 8, 2009 at 8:15 PM, Gary Kline<kline at thought.org> wrote:
>        not surprisingly, i found a fla w in my getc(fp) program that
>        tried to read past "<?" and "?>" ...  the example i added to my
>        test file was simply the 2 bytes "<" and "?".  so if you have a
>        stray
>
>        "<?"
>
>        with a matching close case, the binary hangs on a read.
>        so, again, can anybody suggest a better example, in C, to get
>        past two delimiters?
>
>        one thought is how gcc parses the "/*" and "*/" comment
>        delimiters.  any compiler gurus out there who know
>        where this code is?
>
>        gary
>
>        ?
>

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.

-- 
Glen Barber
http://www.dev-urandom.com
http://www.linkedin.com/in/glenjbarber


More information about the freebsd-questions mailing list