Pádraig Brady <[email protected]> writes:
> Oh right sorry.
>
> syntax check is fine.
Thanks, pushed after fixing an obvious issue with my previous patch [1]:
diff --git a/src/nl.c b/src/nl.c
index 8a423a11b..1b7a08bb2 100644
--- a/src/nl.c
+++ b/src/nl.c
@@ -408,7 +408,7 @@ check_section (void)
{
size_t len = line_buf.length - 1;
- if (len < 2 || footer_del_len < 2
+ if (len < section_del_len || footer_del_len < section_del_len
|| !memeq (line_buf.buffer, section_del, section_del_len))
return Text;
if (len == header_del_len
You think we can add a test for that case? I'm not sure what argument
length limit we can assume. But you can probably trigger a crash with
the previously sent patch using something like this:
$ echo 'a' | nl --section-delimiter $(yes | head -n 10000 | tr -d '\n')
Collin
[1]
https://github.com/coreutils/coreutils/commit/6bbf04db6335a97adf06ad31ab6cea9292ad7d2c