Messages in this thread | | | Date | Wed, 6 Sep 2023 12:09:25 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH] accessibility: speakup: Fix incorrect string length computation in report_char_chartab_status() |
| |
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@linaro.org>
The impact of this bug is a WARN() btw. snprintf() will refuse to print negative bytes.
regards, dan carpenter
| |