Files
heimdal/lib
Daniil Sarafannikov 5b90bc8285 roken:strsep_copy: Fix out-of-bounds write in strsep_copy
In case len < (size_t)(*stringp - save) and len > 0
access to buf[l] leads to out-of-bounds write as
l = len and len means the length of buffer.

Change evaluation of l: only len - 1 elements of
buffer can be used for memcpy and terminator
should be written to buf[len - 1] (in case l = len - 1).
Also, this value of l is not used when len == 0,
so we calculate it only when len > 0.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
2026-06-30 10:19:03 +01:00
..
2026-05-25 17:32:05 -05:00
2024-06-16 23:30:48 -04:00
2026-01-22 23:32:14 -06:00
2024-06-16 23:30:48 -04:00