mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03: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:
1 parent
05613505e5
commit
bb0eb686fc
1 file changed
+1
-1
@@ -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