[comp.bugs.4bsd] tbl bug + fix

daved@physiol.su.oz (Dave Davey) (10/11/88)

tbl will dump core if given a long (>256) input line for a text block.
In tg.c, gettext() calls gets1(line) with line dimensioned to 256,
but gets1 calls fgets with n=BUFSIZ.

Fix:
	in tg.c gettext() change declaration of line to:
	char line[BUFSIZ];

henry@utzoo.uucp (Henry Spencer) (10/15/88)

In article <338@physiol.su.oz> daved@physiol.su.oz (Dave Davey) writes:
>tbl will dump core if given a long (>256) input line for a text block...

Tbl has numerous problems with excessively long lines or fields.  There
is no quick, simple fix; a major overhaul is required.
-- 
The meek can have the Earth;    |    Henry Spencer at U of Toronto Zoology
the rest of us have other plans.|uunet!attcan!utzoo!henry henry@zoo.toronto.edu

guy@auspex.UUCP (Guy Harris) (10/19/88)

>>tbl will dump core if given a long (>256) input line for a text block...
>
>Tbl has numerous problems with excessively long lines or fields.  There
>is no quick, simple fix; a major overhaul is required.

Well, it depends.  "tbl" was changed in some SunOS release, with a non-major
overhaul, not to drop core in at least some of those situations; this
does not completely eliminate the problems, though - it just makes "tbl"
report them somewhat more politely.  (I presume the "major overhaul"
would be to fix it to handle long lines or fields, not just complain
about them.)  If I remember correctly, a number of procedure calls were
changed to take buffer-length arguments, but this was not really a major
overhaul.