Chris Down
41e5ae80b1
pwd: fix heap buffer overflow in file_name_prepend
...
file_name_prepend works by right-aligning path data in a growing buffer.
When the buffer is too small, it then allocates a new buffer via
xpalloc() and copies existing data to the end of the new buffer.
Unfortunately, the memcpy destination is computed as buf + p->n_alloc -
n_free, but xpalloc has already updated p->n_alloc to the new (larger)
allocation size while n_free still reflects the old state. This places
the data at too high an offset, writing past the end of the buffer.
Update to properly calculate the destination offset.
Fixes: v9.5-171-g61ab25c35 ("pwd: prefer xpalloc to xnrealloc")
2026-02-16 10:45:45 +00:00
..
2026-01-18 15:55:38 +00:00
2025-11-19 19:23:36 -08:00
2026-01-21 13:51:40 +00:00
2026-01-28 11:25:36 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2025-12-20 17:25:32 -08:00
2025-12-20 17:25:32 -08:00
2026-01-18 15:55:38 +00:00
2026-01-18 15:55:38 +00:00
2026-01-21 13:51:40 +00:00
2025-12-20 17:25:32 -08:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-18 15:55:38 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2025-12-13 17:18:47 +00:00
2026-01-21 13:51:40 +00:00
2026-01-18 15:55:38 +00:00
2026-01-30 14:12:12 +00:00
2026-01-18 15:55:38 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-18 15:55:38 +00:00
2022-01-31 12:07:39 -08:00
2026-01-21 13:51:58 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-25 19:08:53 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-28 11:25:36 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-02-04 16:42:26 -08:00
2026-01-01 10:56:16 -08:00
2026-01-30 13:31:27 +00:00
2026-01-21 13:51:40 +00:00
2026-01-18 15:55:38 +00:00
2021-10-31 22:36:46 -07:00
2026-02-10 12:24:17 +00:00
2026-01-18 15:55:38 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-18 15:55:38 +00:00
2023-03-13 21:26:21 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-18 15:55:38 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-15 18:21:01 -08:00
2026-01-21 13:51:40 +00:00
2025-05-12 01:28:48 -07:00
2025-12-20 17:25:32 -08:00
2025-12-20 17:25:32 -08:00
2025-12-20 17:25:32 -08:00
2026-01-28 11:25:36 -08:00
2025-12-20 17:25:32 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-02-08 18:45:24 -08:00
2026-01-21 13:51:40 +00:00
2026-01-24 13:49:03 +00:00
2026-01-28 11:25:36 -08:00
2024-05-05 17:50:28 +01:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-02-09 22:30:48 -08:00
2026-02-06 13:37:58 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-02-16 10:45:45 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-18 15:55:38 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-18 15:55:38 +00:00
2026-01-01 10:56:16 -08:00
2026-02-14 14:48:45 -08:00
2026-01-21 13:51:39 +00:00
2026-01-01 10:56:16 -08:00
2025-11-03 13:00:32 +00:00
2024-05-05 17:50:14 +01:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2025-07-09 17:12:40 -07:00
2026-01-21 13:51:40 +00:00
2026-01-22 16:15:26 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2023-02-06 13:09:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-31 22:08:09 +00:00
2026-01-18 15:55:38 +00:00
2026-01-21 13:51:40 +00:00
2026-01-24 20:00:32 +00:00
2026-01-21 13:51:40 +00:00
2026-01-18 15:55:38 +00:00
2023-07-18 23:10:40 +01:00
2025-11-22 12:43:28 +00:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2025-12-20 17:25:32 -08:00
2025-12-20 17:25:32 -08:00
2026-01-21 13:51:40 +00:00
2025-12-20 17:25:32 -08:00
2026-02-06 14:43:24 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-21 13:51:40 +00:00
2025-09-30 14:09:37 +01:00
2026-02-14 14:48:45 -08:00
2026-01-21 13:51:40 +00:00
2026-01-21 13:51:40 +00:00