Re: [PATCH] accessibility: speakup: Fix incorrect string length computation in report_char_chartab_status()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux