[Top][All Lists]

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

Re: fix the sscanf usage in etags

From: Kevin Ryde
Subject: Re: fix the sscanf usage in etags
Date: Thu, 10 Aug 2006 10:15:12 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

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 ".  I'd
suggest (untested) something like

        start = -1;
        if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1
            && start != -1)

reply via email to

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