This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Patch to prevent tilde crashing readline
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: qqxnjvamvxwx at spammotel dot com
- Cc: gdb-patches at sources dot redhat dot com, bash-maintainers at gnu dot org
- Date: Sun, 3 Jul 2005 10:23:37 +0200 (CEST)
- Subject: Re: Patch to prevent tilde crashing readline
- References: <20050702224856.037DC1D14D@cpc4-cmbg1-6-0-cust148.cmbg.cable.ntl.com>
From: Martin Simmons <qqxnjvamvxwx@spammotel.com>
Date: Sat, 2 Jul 2005 23:48:56 +0100 (BST)
Here is a patch to the gdb readline to fix a typo in the MinGW changes. The
current CVS gdb segfaults on x86_64 FC3 Linux whenever ~ is used, e.g.
source ~martin/my-commands
The segfault is in strlen(), called from tilde_expand(), because
tilde_expand_word() returns NULL when HAVE_GETPWNAM is not defined
(i.e. always!). Someone should fix tilde_expand_word() to do the existing
else clause in this case.
Oops, Thanks Martin! I committed the attached patch (since it is
obviously correct).
Chet, I'm not sure whether you incorporated Mark Mitschell's MinGW
changes yet, but you'll at least want to apply this change.
Mark
Index: ChangeLog.gdb
from Mark Kettenis <kettenis@gnu.org>
From Martin Simmons:
* configure.in: Check for getpwnam instead of getpwname.
* configure: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/readline/configure.in,v
retrieving revision 1.7
diff -u -p -r1.7 configure.in
--- configure.in 9 May 2005 19:42:03 -0000 1.7
+++ configure.in 3 Jul 2005 08:18:03 -0000
@@ -120,7 +120,7 @@ AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl kill lstat memmove putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit \
- getpwname getpwent getpwuid)
+ getpwnam getpwent getpwuid)
AC_FUNC_STRCOLL