Re: [PATCH v3] seq_buf: add seq_buf_strlen(), seq_buf_init_append(), seq_buf_puts_trunc()
From: Kees Cook
Date: Thu Sep 17 2026 - 10:32:44 EST
On September 16, 2026 6:13:59 PM PDT, Bill Wendling <morbo@xxxxxxxxxx> wrote:
>Converting some strlcat() call sites seq_buf need behavior seq_buf
>doesn't currently provide, either directly or without introducing subtle
>bugs:
Ah, our implementations have crossed paths in flight. :)
> - seq_buf_strlen(): seq_buf_used() reports the full buffer size when
We agree, we need this one. :)
> - seq_buf_init_append(): seq_buf_init() always clears the buffer it's
Oh, nice, yeah this is cool. I'd like a different name that mentions "str"? Maybe _from_str?
> - seq_buf_puts_trunc(): seq_buf_puts() (like seq_buf_printf() and
I prefer my solution that just truncates and sets overflow. Nothing i found needed the non-trunc behavior.
I'll send a v2 of the other series with seq_buf_init_from_str?
-Kees
--
Kees Cook