bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: bug: grep 2.5e - error message is bad for incorrect "-C" arg


From: Alain Magloire
Subject: Re: bug: grep 2.5e - error message is bad for incorrect "-C" arg
Date: Mon, 26 Mar 2001 11:09:50 -0500 (EST)

> 
> Found this:
> 
>     % grep -Cx
>     grep: x: invalid context length argument: !ùÿ¿&ùÿ¿
>     
>     % grep --version
>     grep (GNU grep) 2.5e
>     ...
> 
> The offending line looks like src/grep.c +191: 
> 
>    183  static void
>    184  context_length_arg (char const *str, int *out)
>    185  {
>    186    uintmax_t value;
>    187    if (! (xstrtoumax (str, 0, 10, &value, "") == LONGINT_OK
>    188           && 0 <= (*out = value)
>    189           && *out == value))
>    190      {
>    191        error (2, 0, "%s: %s: %s\n", str, _("invalid context length 
> argument"));
> 
> So it's just dumping an uninitilized location, not dependant on the
> command line, and probably not exploitable?

Exploitable?  a big word.

> But I'm not sure I fully
> grasp the macros involved, since I just looked at this quickly.

The number of formating cookies were incorrect.

Thanks for the bug report, it has already been fix in the repository.

error (2, 0, "%s: %s\n", str, _("invalid context length argument"));

2001-03-17  Alain Magloire

        * src/grep.c (context_length_arg): error () passing wrong format.
        Spotted by Jim Meyering.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!




reply via email to

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