[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#611151: texinfo: Segmentation fault when screen is resized to 5 or less rows



Package: texinfo
Version: 4.13a.dfsg.1-6
Severity: normal


This bug is easy to reproduce.  Simply run "info" in a terminal, then
resize the terminal to have a height smaller than 6.  The info program
immediately exits with a segmentation fault.

The problem is that window.c:window_line_of_point() can return a
negative index.  A simple fix is to sanity check the output (patch
attached). 

That patch will prevent segmentation faults, but there is still
something wrong with the arithmetic, probably in
window_new_screen_size() which is a mess.  Shrinking and enlarging the
buffer repeatedly leaves a gap, but that's the subject for another
bug.

--- info/window.c.orig	2008-09-18 11:31:59.000000000 -0700
+++ info/window.c	2011-01-25 16:16:27.000000000 -0800
@@ -923,7 +923,13 @@
         break;
     }
 
-  return i - 1;
+  /* Something is wrong with the above logic as it allows a negative
+     index to be returned for small windows.  Until someone figures it
+     out, at least don't core dump. */
+  if (i>0)
+    return i - 1;
+  else
+    return 0;
 }
 
 /* Get and return the goal column for this window. */



-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages texinfo depends on:
ii  libc6                         2.11.2-7   Embedded GNU C Library: Shared lib

texinfo recommends no packages.

Versions of packages texinfo suggests:
ii  texinfo-doc-nonfree           4.13a-1    texinfo and info documentation tha
pn  texlive-base                  <none>     (no description available)
pn  texlive-generic-recommended   <none>     (no description available)
pn  texlive-latex-base            <none>     (no description available)

-- no debconf information



Reply to: