mirror of
git://git.sv.gnu.org/coreutils
synced 2026-05-27 02:51:18 -04:00
(main): Fix off-by-one error.
pr -$(perl -e 'print "0"x63 . 1') would write one byte beyond the end of a malloc'd buffer.
This commit is contained in:
@@ -892,7 +892,7 @@ main (int argc, char **argv)
|
||||
if (ISDIGIT (c))
|
||||
{
|
||||
/* Accumulate column-count digits specified via old-style options. */
|
||||
if (n_digits == n_alloc)
|
||||
if (n_digits + 1 >= n_alloc)
|
||||
column_count_string
|
||||
= x2nrealloc (column_count_string, &n_alloc,
|
||||
sizeof *column_count_string);
|
||||
|
||||
Reference in New Issue
Block a user