Danilo Krummrich
2025-Aug-09 12:00 UTC
[PATCH] drm/nouveau: replace snprintf() with scnprintf() in nvkm_snprintbf()
On 7/24/25 9:59 PM, Seyediman Seyedarab wrote:> snprintf() returns the number of characters that *would* have been > written, which can overestimate how much you actually wrote to the > buffer in case of truncation. That leads to 'data += this' advancing > the pointer past the end of the buffer and size going negative. > > Switching to scnprintf() prevents potential buffer overflows and ensures > consistent behavior when building the output string. > > Signed-off-by: Seyediman Seyedarab <ImanDevel at gmail.com>Applied to drm-misc-next, thanks!