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
..
2026-11-07 12:35:10 +00:00
2026-10-25 13:11:49 +00:00
2026-11-01 19:26:16 -08:00
2026-11-08 15:29:10 +00:00
2026-11-14 20:26:42 +00:00
2026-11-08 15:29:10 +00:00
2026-01-01 10:56:16 -08:00
2026-11-07 12:35:10 +00:00
2026-04-22 19:12:44 -07:00
2026-11-15 12:30:40 +00:00
2026-11-12 22:42:06 -08:00
2026-11-10 12:52:08 +00:00
2026-11-08 14:17:59 +00:00
2026-11-05 17:28:27 +00:00
2026-11-13 18:27:05 -08:00
2026-11-08 13:59:08 +00:00
2026-11-10 20:01:17 +00:00
2026-11-07 12:35:10 +00:00
2026-07-27 13:52:51 +01:00
2026-10-23 19:30:36 -07:00
2026-10-24 16:15:03 +01:00
2026-10-07 12:40:05 +01:00
2026-01-01 10:56:16 -08:00
2026-11-07 12:35:10 +00:00
2026-10-25 13:11:49 +00:00
2026-01-01 10:56:16 -08:00
2026-11-08 15:29:10 +00:00
2026-11-07 12:35:10 +00:00
2026-11-07 12:35:10 +00:00
2026-11-10 16:48:39 +00:00
2026-11-08 15:29:10 +00:00
2026-11-07 12:35:10 +00:00
2026-10-31 23:03:30 -07:00
2026-10-04 15:31:59 -07:00
2026-11-05 18:27:53 -08:00
2026-06-16 18:48:15 +01:00
2026-11-07 12:35:10 +00:00
2026-09-10 16:40:06 +01:00
2026-11-07 12:35:10 +00:00
2026-11-10 20:30:37 +00:00
2026-11-08 13:59:08 +00:00
2026-11-15 12:32:36 +00:00
2026-11-07 12:35:10 +00:00
2026-08-10 22:24:21 +01:00
2026-09-10 16:40:06 +01:00
2026-11-07 12:35:10 +00:00
2026-11-07 12:35:10 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-11-02 23:43:14 +00:00
2026-11-06 17:06:42 -08:00
2026-06-30 18:26:51 +01:00
2026-11-09 00:24:53 +00:00
2026-11-13 18:47:23 -08:00
2026-11-07 12:35:10 +00:00
2026-10-21 12:54:34 +01:00
2026-03-04 17:57:54 +00:00
2026-11-10 21:04:45 +00:00
2026-10-25 13:11:49 +00:00
2026-07-26 12:44:01 -07:00
2026-11-13 20:12:25 -08:00
2026-04-10 11:09:10 +01:00
2026-11-06 23:55:28 +00:00
2026-08-13 22:32:56 -07:00
2026-04-09 21:25:27 +01:00
2026-11-07 12:35:10 +00:00
2026-11-09 00:13:34 +00:00
2026-11-07 12:35:10 +00:00
2026-08-18 22:12:31 -07:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2015-11-06 16:40:42 +00:00
2026-01-01 10:56:16 -08:00
2011-04-13 11:18:48 +01:00
2012-09-14 10:20:03 +02:00
2006-08-16 20:11:42 +00:00
2026-11-15 12:30:40 +00:00
2015-11-10 13:03:33 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 20:50:59 -08:00
2021-05-12 22:14:11 +01:00