Ismail Ramzi
3b77964c3c
pr: avoid a heap overflow with a very wide line number
...
With -n and truncated lines, add_line_number() added NUMBER_WIDTH to
INPUT_POSITION without checking for overflow. A tab at the start of a
line followed by a line number width near INT_MAX would wrap
INPUT_POSITION negative, and with -e the next tab would then be
expanded by more than the tab width, writing past the end of CLUMP_BUFF.
E.g., printf '\t\t\n' | pr -t -e -W2147483647 -n:2147483643
wrote 12 bytes into an 8 byte buffer.
* src/pr.c (add_line_number): Use ckd_add when advancing INPUT_POSITION.
(init_parameters): Likewise when computing NUMBER_WIDTH,
which overflowed with -n:2147483647.
* tests/pr/options.sh: Add test cases.
* NEWS: Mention the bug fix.
Link: https://github.com/coreutils/coreutils/pull/458
2026-11-15 12:32:36 +00:00
..
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2026-04-15 15:08:27 +01:00
2001-03-17 08:49:25 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
2026-11-07 11:48:00 -08:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
1996-12-28 05:14:37 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2001-03-17 08:49:25 +00:00
2001-03-17 08:49:25 +00:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2009-03-07 23:52:08 +01:00
2026-11-15 12:32:36 +00:00
2026-01-01 10:56:16 -08:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1999-04-15 13:26:50 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1996-12-28 05:14:37 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1997-02-16 19:08:01 +00:00
1997-02-16 19:08:01 +00:00
1997-02-16 19:08:01 +00:00
1997-02-16 19:08:01 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
1999-04-15 13:26:50 +00:00
2007-07-04 12:45:10 +02:00
2010-01-06 21:07:23 -07:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00
2007-07-04 12:45:10 +02:00