public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* rtc-ds1307.c: array overrun
@ 2007-07-23  0:44 Adrian Bunk
  2007-07-23  1:17 ` David Brownell
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2007-07-23  0:44 UTC (permalink / raw)
  To: Rodolfo Giometti, David Brownell, a.zummo; +Cc: rtc-linux, linux-kernel

The Coverity checker spotted the following array overrun
in drivers/rtc/rtc-ds1307.c:

<--  snip  -->

...
#define DS1337_REG_CONTROL      0x0e
...
struct ds1307 {
        u8                      reg_addr;
        u8                      regs[8];
...
};
...
static int __devinit ds1307_probe(struct i2c_client *client)
{
...
                                        ds1307->regs[DS1337_REG_CONTROL]
...

<--  snip  -->


0x0e > 8


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-25  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23  0:44 rtc-ds1307.c: array overrun Adrian Bunk
2007-07-23  1:17 ` David Brownell
2007-07-25  1:37   ` [rtc-linux] " Alessandro Zummo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox