diff options
author | Jim Meyering <jim@meyering.net> | 2005-04-03 13:12:53 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-04-03 13:12:53 +0000 |
commit | bb0eb686fcbb39619e2ca11819435ff5c8d92113 (patch) | |
tree | ff2df6736d8c37d30e1dae08d35a24f2d47af6e9 | |
parent | 05613505e521a669d8bff1d701a29857112c6322 (diff) | |
download | coreutils-bb0eb686fcbb39619e2ca11819435ff5c8d92113.tar.xz |
(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.
-rw-r--r-- | src/pr.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |