Files
Yury V. Zaytsev 18079626c6 Ticket #4642: extract and re-implement str_chomp to fix buffer overflow, add tests
Found in Alpine/musl on s390x, confirmed on aarch64 using valgrind - introduced
in 65a7278d8a:

{{{
==156518== Invalid read of size 1
==156518==    at 0x413BE0: vfs_parse_ls_lga (parse_ls_vga.c:863)
==156518==    by 0x4076C3: process_ls_line (mc_parse_ls_l.c:350)
==156518==    by 0x4076C3: process_input (mc_parse_ls_l.c:376)
==156518==    by 0x40736B: main (mc_parse_ls_l.c:404)
==156518==  Address 0x536be6f is 1 bytes before a block of size 2 alloc'd
==156518==    at 0x48854F0: malloc (vg_replace_malloc.c:446)
==156518==    by 0x4CF4FCB: g_malloc (gmem.c:100)
==156518==    by 0x4D0E99B: g_strdup (gstrfuncs.c:323)
==156518==    by 0x413887: g_strdup_inline (gstrfuncs.h:321)
==156518==    by 0x413887: vfs_parse_ls_lga (parse_ls_vga.c:848)
==156518==    by 0x4076C3: process_ls_line (mc_parse_ls_l.c:350)
==156518==    by 0x4076C3: process_input (mc_parse_ls_l.c:376)
==156518==    by 0x40736B: main (mc_parse_ls_l.c:404)
}}}

https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/79071

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2025-01-30 15:27:09 +01:00
..
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2025-01-25 18:04:54 +03:00
2025-01-11 12:14:08 +03:00
2023-08-04 21:04:54 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2012-09-10 14:29:53 +03:00
2025-01-11 12:14:08 +03:00
2023-10-15 16:04:39 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2020-10-13 16:34:55 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2025-01-11 12:14:08 +03:00
2020-03-08 20:17:29 +03:00