[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Texinfo segfault bug, and fix
From: |
Ben Pfaff |
Subject: |
Texinfo segfault bug, and fix |
Date: |
Thu, 14 Aug 2008 21:35:19 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
By mistake, I typed the command "makeinfo texinfo.tex" in
Texinfo's doc directory and was surprised to get a segfault. I
then deleted lines and characters until I reproduced the segfault
with a file that contains the following single line:
address@hidden
The problem is an attempt to free() a string that was not
allocated with malloc().
Here is the fix:
--- makeinfo.c 14 Aug 2008 21:00:52 -0700 1.120
+++ makeinfo.c 14 Aug 2008 21:28:11 -0700
@@ -2374,7 +2374,7 @@ remember_brace_1 (COMMAND_FUNCTION (*pro
BRACE_ELEMENT *new = xmalloc (sizeof (BRACE_ELEMENT));
new->next = brace_stack;
new->proc = proc;
- new->command = command ? xstrdup (command) : "";
+ new->command = xstrdup (command ? command : "");
new->pos = position;
new->line = line_number;
new->in_fixed_width_font = in_fixed_width_font;
--
Peter Seebach on managing engineers:
"It's like herding cats, only most of the engineers are already
sick of laser pointers."
- Texinfo segfault bug, and fix,
Ben Pfaff <=