lkml.org 
[lkml]   [2011]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectleds: leds-tca6507: off by one in choose_times()
Hi Neil,

Smatch complains about 7a9244d89523 "leds: add driver for TCA6507 LED
controller"

drivers/leds/leds-tca6507.c +185 choose_times(16)
error: buffer overflow 'time_codes' 16 <= 16

184 for (c1 = 1; c1 <= TIMECODES; c1++) {
185 int t = time_codes[c1];
^^^^^^^^^^^^^
We're reading 1 past the end of the array here.

186 if (t*2 < tmin)
187 continue;

regards,
dan carpenter


\
 
 \ /
  Last update: 2011-12-16 13:33    [W:0.035 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site