[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fix the sscanf usage in etags

From: Jan Djärv
Subject: Re: fix the sscanf usage in etags
Date: Thu, 10 Aug 2006 08:47:16 +0200
User-agent: Thunderbird (X11/20060808)

Kevin Ryde skrev:
Masatake YAMATO <address@hidden> writes:
The problem I found was that etags crashed when `#line 123 L"wide"' was given
as input. If the crashing can be suppressed, it is enough.

That's the only bad case, you don't have some strange libc that
incorrectly counts %n?

Jan Djärv <address@hidden> writes:
          if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1
              && lbp->buffer[start] == '"')

I think that still uses start uninitialized on say "#line 123 ".

No, in that case start will be 10. If the %d matches, sscanf will return 1 and in that case %n must match (whitespace is optional).

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]