Bug 211484 - CVE-2006-4810 texindex buffer overflow
CVE-2006-4810 texindex buffer overflow
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: texinfo (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
Ben Levenson
: Security
Depends On:
  Show dependency treegraph
Reported: 2006-10-19 13:42 EDT by Josh Bressers
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHSA-2006-0727
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-11-08 05:02:24 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0727 moderate SHIPPED_LIVE Moderate: texinfo security update 2006-11-08 05:02:05 EST

  None (edit)
Description Josh Bressers 2006-10-19 13:42:00 EDT
Miloslav Trmac found a heap overflow in the way texindex handles data from
certain index files.

The texindex utility contains a heap overflow; when the data for a
generated index is larger than 500,000 bytes, an incorrect reallocation
code in readline() allows heap overflow by index lines longer than 400

It looks like the code in readline() of texindex.c has some crazy arithmetic.

 char *buffer = linebuffer->buffer;
 char *p = linebuffer->buffer;
 char *end = p + linebuffer->size;

 while (1)
  int c = getc (stream);
  if (p == end)
   buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
   p += buffer - linebuffer->buffer;
   end += buffer - linebuffer->buffer;
   linebuffer->buffer = buffer;

It would seem that when p == end, p and end are assigned what could be a random
memory addresses as the location of buffer is likely to change with a realloc
from a size of 200 to 400 bytes. p then proceedes to dump trash on the heap
until the current line ends.
Comment 1 Josh Bressers 2006-10-19 13:44:11 EDT
This issue also affects RHEL2 and RHEL3
Comment 7 Mark J. Cox 2006-11-08 03:56:29 EST
removing embargo
Comment 8 Red Hat Bugzilla 2006-11-08 05:02:24 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.