summaryrefslogtreecommitdiff
path: root/rust/kernel/platform.rs
diff options
context:
space:
mode:
authorSeyediman Seyedarab <imandevel@gmail.com>2025-07-24 15:59:13 -0400
committerDanilo Krummrich <dakr@kernel.org>2025-08-09 12:20:46 +0200
commit6510b62fe9303aaf48ff136ff69186bcfc32172d (patch)
treea16a3c9faa6a031c27b6e895f6046048a1809f34 /rust/kernel/platform.rs
parentd2b48f2b30f25997a1ae1ad0cefac68c25f8c330 (diff)
drm/nouveau: replace snprintf() with scnprintf() in nvkm_snprintbf()
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> Link: https://lore.kernel.org/r/20250724195913.60742-1-ImanDevel@gmail.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/platform.rs')
0 files changed, 0 insertions, 0 deletions