Re: [PATCH] thinkpad_acpi: fix: use scnprintf instead of snprintf.

2021-01-15 Thread Henrique de Moraes Holschuh
On Wed, 06 Jan 2021, Joe Perches wrote: > On Wed, 2021-01-06 at 14:36 +0800, YANG LI wrote: > > The snprintf() function returns the number of characters which would > > have been printed if there were enough space, but the scnprintf() > > returns the number of characters which were actually printed

Re: [PATCH] thinkpad_acpi: fix: use scnprintf instead of snprintf.

2021-01-06 Thread Hans de Goede
Hi, On 1/6/21 10:01 AM, Joe Perches wrote: > On Wed, 2021-01-06 at 14:36 +0800, YANG LI wrote: >> The snprintf() function returns the number of characters which would >> have been printed if there were enough space, but the scnprintf() >> returns the number of characters which were actually printe

Re: [PATCH] thinkpad_acpi: fix: use scnprintf instead of snprintf.

2021-01-06 Thread Joe Perches
On Wed, 2021-01-06 at 14:36 +0800, YANG LI wrote: > The snprintf() function returns the number of characters which would > have been printed if there were enough space, but the scnprintf() > returns the number of characters which were actually printed. If the > buffer is not large enough, then usin

[PATCH] thinkpad_acpi: fix: use scnprintf instead of snprintf.

2021-01-05 Thread YANG LI
The snprintf() function returns the number of characters which would have been printed if there were enough space, but the scnprintf() returns the number of characters which were actually printed. If the buffer is not large enough, then using snprintf() would result in a read overflow and an inform