[PATCH v4 0/2] lib/vsprintf: Fixes size check

From: Masami Hiramatsu (Google)

Date: Tue Mar 24 2026 - 22:25:55 EST


Hi,

Here is the 4th version of patches to fix vsnprintf().

- Fix to limit the size of width and precision.
- Warn if the return size is over INT_MAX.

Previous version is here;

https://lore.kernel.org/all/177410406326.38798.16853803119128725972.stgit@devnote2/

In this version, do clamp() the width and precision before checking it and
accept negative precision[1/3] and add Petr's Reviewed-by[2/2].

Thank you,

---

Masami Hiramatsu (Google) (2):
lib/vsprintf: Fix to check field_width and precision
lib/vsprintf: Limit the returning size to INT_MAX


lib/vsprintf.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>