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

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

Re: lid, from id-utils, tries to write to a constant string, then crashe


From: AJ Reins
Subject: Re: lid, from id-utils, tries to write to a constant string, then crashes.
Date: Mon, 12 May 2003 18:47:35 -0700 (PDT)

--- Aidan Kehoe <address@hidden> wrote:
> 
> Hi, 
> 
> My input; the command line arguments -ils and a thirty-five megabyte
> database specified with the IDPATH environment variable.
> 
> What I expected; nothing in particular; I was just wondering what the aid
> command did.
> 
> What I got; "segmentation fault (core dumped)."
> 
> Why this is wrong; Crashing is bad, mmmkay?
> 
> How to reproduce; Run "lid -ils". Watch it core dump in lower_caseify as it
> tries to write to ".". You may need to set the IDPATH environment variable
> so it finds a database file automatically.
> 
> Fix; 
> 
> diff -u src/lid.c~ src/lid.c
> --- src/lid.c~  2003-05-10 11:33:11.000000000 +0000
> +++ src/lid.c   2003-05-11 17:38:40.000000000 +0000
> @@ -398,9 +398,10 @@
>    argv += optind;
>    if (argc == 0)
>      {
> -      static char *dot = (char *) ".";
> +      static char dot[] = ".";
> +      char *dot0 = dot; 
>        argc = 1;
> -      argv = &dot;
> +      argv = &dot0;
>      }
>  
>    /* Look for the ID database up the tree */
> 
> Bye, 
> 
>      - Aidan Kehoe

In 3.2d that particular piece of code looks like:
  if (argc == 0)
    {
      static char dot[] = ".";
      static char *dotp = dot;
      argc = 1;
      argv = &dotp;
    }

So it appears your patch is already in. 3.2d is still at alpha.gnu.org,
if you are interested.


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com




reply via email to

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