Thread (4 messages) flat view 4 messages, 3 authors, 20d ago

Re: [PATCH] staging: fbtft: prefer scnprintf over sprintf in fbtft-core.c

From: Dan Carpenter <hidden>
Date: 2026-08-19 18:21:09
Also in: dri-devel, linux-staging, lkml

On Wed, Aug 19, 2026 at 08:06:39PM +0300, Andy Shevchenko wrote:
quoted
(text1[50] and text2[50]) so the write is always bounded.
quoted
In practice an overflow is very unlikely here: text1 only needs
room for a size_t value from an SPI TX buffer length, and text2
formats three small integers (bus number, chip select, and
frequency in MHz) that always come from real hardware ranges far
below the theoretical worst case for their types. This is
therefore a defense-in-depth hardening rather than a fix for an
observed or easily triggered issue.
This paragraph is not for the commit message, rather for the comment.
The paragraph describes the expected impact of the patch and it
belongs in the commit message.  My problem is with it is that it's
1) Wrong because it says unlikely instead of impossible. And 2) goes
into too much unnecessary detail. We don't need to know where the
values come from since even the worst case for the type could fit.

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help