On Mon, Sep 04, 2023 at 09:31:44PM +0200, Christophe JAILLET wrote: > snprintf() returns the "number of characters which *would* be generated for > the given input", not the size *really* generated. > > In order to avoid too large values for 'len' (and potential negative > values for "sizeof(buf) - (len - 1)") use scnprintf() instead of > snprintf(). > A bunch of kernel-janitors mail didn't reach my inbox... Like this one. So weird. Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> The impact of this bug is a WARN() btw. snprintf() will refuse to print negative bytes. regards, dan carpenter