Re: [PATCH] kernel/cpu: fix: use scnprintf or sprintf.

2020-12-23 Thread Qais Yousef
Hi Yang 'or sprintf' in the subject line doesn't make much sense for what's done in this patch. Perhaps you meant "Use scnprintf instead of snprintf"? On 12/22/20 17:11, YANG LI wrote: > The snprintf() function returns the number of characters which would > have been printed if there were enough

[PATCH] kernel/cpu: fix: use scnprintf or sprintf.

2020-12-22 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