[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#74278: info: Segfault if return key pressed in "SEE ALSO" sectio
From: |
H. Nanosecond |
Subject: |
Re: Bug#74278: info: Segfault if return key pressed in "SEE ALSO" section |
Date: |
Mon, 9 Oct 2000 05:35:04 -0400 (EDT) |
The problem is from the below bit of code.
If the cursor is before the first reference when you press enter
then the variable 'which' will be -1 after the loop,
causing a memory error when refs[which] is accessed.
SEE ALSO
X apropos(1), whatis(1), less(1), groff(1).
^ cursor here.
>I get a segfault when I run info on a command such as "as" or "man"
>that has only a man page, move the curson into the "SEE ALSO"
>section and press the Enter key.
At texinfo-4.0/info/session.c line 2043:
{
int which = 0;
/* Find the closest reference to point. */
if (builder == info_xrefs_of_node)
{
int closest = -1;
for (; refs[which]; which++)
{
if ((window->point >= refs[which]->start) &&
(window->point <= refs[which]->end))
{
closest = which;
break;
}
else if (window->point < refs[which]->start)
{
break;
}
}
if (closest == -1)
which--;
else
which = closest;
}
defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
defentry->label = xstrdup (refs[which]->label);
defentry->filename = refs[which]->filename;
defentry->nodename = refs[which]->nodename;