[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lid, from id-utils, tries to write to a constant string, then crashes.
From: |
Aidan Kehoe |
Subject: |
lid, from id-utils, tries to write to a constant string, then crashes. |
Date: |
Mon, 12 May 2003 07:42:38 +0100 |
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 = ˙
+ argv = &dot0;
}
/* Look for the ID database up the tree */
Bye,
- Aidan Kehoe
--
"It may sound unorthodox to say so, but this is going to hurt you much more
than it will hurt me." -- Saki, "The Unbearable Bassington", 1912
- lid, from id-utils, tries to write to a constant string, then crashes.,
Aidan Kehoe <=