[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Info crashes while MALLOC_CHECK_ env. var. is set
From: |
Karl Berry |
Subject: |
Re: Info crashes while MALLOC_CHECK_ env. var. is set |
Date: |
Thu, 22 Aug 2002 10:16:35 -0400 |
info is crashing and core is
dumped immediately after running if the MALLOC_CHECK_ environment
variable is set to 2.
Thanks. Another contributor just sent a patch for this, in case you're
interested ...
Date: Mon, 19 Aug 2002 16:11:18 +0200
From: "Andreas Herrmann" <address@hidden>
To: address@hidden
Cc: address@hidden
Subject: BUG in info command
Hi,
Recently I tried to use info on a RedHat 7.3 system (info (GNU
texinfo) 4.2). And it crashed with SIGSEGV. Setting MALLOC_CHECK_=2
info aborted. So obviously usage of malloc/free was somewhat
erroneous.
I downloaded texinfo-4.2.tar.gz for debugging. Unfortunately I didn't
got a SIGSEGV anymore. But using MALLOC_CHECK_=2 it aborted again. I
determined the following error: In function replace_in_documentation()
determination of length for repstr (which is allocated later on) is
false in case argstr is empty. Later on strcat() is called, but
repstr is then too short to concatenate rep to it.
See below patch to fix the bug.
Regards,
Andreas
diff -Naur texinfo-4.2/info/infodoc.c texinfo-4.2-new/info/infodoc.c
--- texinfo-4.2/info/infodoc.c Wed Feb 27 13:37:33 2002
+++ texinfo-4.2-new/info/infodoc.c Mon Aug 19 15:47:55 2002
@@ -1006,7 +1006,7 @@
rep = command ? where_is (info_keymap, command) : NULL;
if (!rep)
rep = "N/A";
- replen = (argstr ? strlen (argstr) + 1 : 0) + strlen (rep);
+ replen = (argstr ? strlen (argstr) : 0) + strlen (rep) + 1;
repstr = (char *)xmalloc (replen);
repstr[0] = '\0';
if (argstr)
_______________________________________________
Bug-texinfo mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/bug-texinfo