* Re: [PATCH] drm/nouveau: replace snprintf() with scnprintf() in nvkm_snprintbf()
[not found] <20250724195913.60742-1-ImanDevel@gmail.com>
@ 2025-08-09 12:00 ` Danilo Krummrich
0 siblings, 0 replies; only message in thread
From: Danilo Krummrich @ 2025-08-09 12:00 UTC (permalink / raw)
To: Seyediman Seyedarab
Cc: lyude, airlied, simona, dri-devel, nouveau, linux-kernel
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@gmail.com>
Applied to drm-misc-next, thanks!
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-09 12:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250724195913.60742-1-ImanDevel@gmail.com>
2025-08-09 12:00 ` [PATCH] drm/nouveau: replace snprintf() with scnprintf() in nvkm_snprintbf() Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).