emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 09 Aug 2006 10:06:24 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Masatake YAMATO <address@hidden> writes:
>
> -       if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1)
> +       if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 2)

I think that's wrong, I believe %n is not included in the return
count.  Eg. in the current glibc, and in the posix spec (under "n"),

    http://www.opengroup.org/onlinepubs/007904975/functions/scanf.html

It does look like there's a problem with degenerate input having
"start" used uninitialized though.  Eg. say

        #line 00000000000000000000000000000




reply via email to

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