lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] rtc: fix snprintf() checking in is_rtc_hctosys()
Date
On Tue, 11 May 2021 10:19:26 +0300, Dan Carpenter wrote:
> The scnprintf() function silently truncates the printf() and returns
> the number bytes that it was able to copy (not counting the NUL
> terminator). Thus, the highest value it can return here is
> "NAME_SIZE - 1" and the overflow check is dead code. Fix this by
> using the snprintf() function which returns the number of bytes that
> would have been copied if there was enough space and changing the
> condition from "> NAME_SIZE" to ">= NAME_SIZE".

Applied, thanks!

[1/1] rtc: fix snprintf() checking in is_rtc_hctosys()
commit: 54b909436ede47e0ee07f1765da27ec2efa41e84

Best regards,
--
Alexandre Belloni <alexandre.belloni@bootlin.com>

\
 
 \ /
  Last update: 2021-05-25 00:37    [W:0.043 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site