Re: [PATCH v4] lib/bootconfig: guard xbc_node_compose_key_after() buffer size

From: Steven Rostedt

Date: Wed Mar 18 2026 - 09:45:34 EST


On Wed, 18 Mar 2026 09:02:43 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > This was somewhat my idea. Why do you think it's over engineering?
> >
> > This is your code, so you have final say. I'm not going to push it. I'm
> > just curious to your thoughts.
>
> I sent a mail why I thought this is over engineering. I think this
> comes from vsnprintf() interface design. If all user of that needs
> to do this, that is not fair. It should be checked in vsnprintf()
> and caller should just check the returned error.

I wouldn't call this over-engineering. The reason you gave is more about
the checks being simply in the inappropriate location.

Over-engineering is if the patch had created 5 different macros to see if
the value passed to snprintf() was size_t and could be greater than MAX_INT,
and it used the trick of TRACE_EVENT() to create the code to do those
checks. Now THAT would be over-engineering! ;-)

-- Steve