Re: [PATCH v6] tracing: Bound synthetic-field strings with seq_buf

From: Steven Rostedt

Date: Fri May 01 2026 - 13:27:03 EST


On Fri, 01 May 2026 12:10:39 -0500
Tom Zanussi <zanussi@xxxxxxxxxx> wrote:

> > + /* Terminate synthetic_name with a NUL. */
> > + seq_buf_str(&s);
> > +
>
> This doesn't hurt, but is it really needed? I think seq_buf_printf()
> already null-terminates.

Technically it does, but it's not guaranteed to do so. That is, only
seq_buf_str() defines terminating the string in the API.

-- Steve