Re: [PATCH v2 net-next] net: 6lowpan: replace sprintf() with scnprintf() in debugfs

Jakub Kicinski <[email protected]> Thu, 8 Jan 2026 18:02:21 -0800
Newsgroups org.kernel.vger.linux-wpan,org.kernel.vger.linux-bluetooth,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On Tue,  6 Jan 2026 17:16:11 +0000 Kathara Sasikumar wrote:
> sprintf() does not perform bounds checking on the destination buffer.
> Replace it with scnprintf() to ensure the write stays within bounds.

Aren't compilers clever enough these days to warn about potential
overflows? AFAICT the buffer is 32B so it will definitely fit %d
no matter what.
-- 
pw-bot: reject