mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/media/video/bt866.c: array overflows
@ 2006-08-14 23:23 Adrian Bunk
  2006-08-15  6:06 ` Martin Samuelsson
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2006-08-14 23:23 UTC (permalink / raw)
  To: Martin Samuelsson, mchehab; +Cc: v4l-dvb-maintainer, linux-kernel

The Coverity checker spotted the following two array overflows:


<--  snip  -->

...
struct bt866 {
...
        unsigned char reg[128];
...
}
...
static int bt866_do_command(struct bt866 *encoder,
                        unsigned int cmd, void *arg)
{
...
                val = encoder->reg[0xdc];
...
                bt866_write(encoder, 0xdc, val);
...
}
...
static int bt866_write(struct bt866 *encoder,
                        unsigned char subaddr, unsigned char data)
{
...
        encoder->reg[subaddr] = data;
...
}
...

<--  snip  -->


The two bugs are obvious:
  0xdc = 220 >= 128


cu
Adrian

-- 

    Gentoo kernels are 42 times more popular than SUSE kernels among
    KLive users  (a service by SUSE contractor Andrea Arcangeli that
    gathers data about kernels from many users worldwide).

       There are three kinds of lies: Lies, Damn Lies, and Statistics.
                                                    Benjamin Disraeli


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

end of thread, other threads:[~2006-08-15 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-14 23:23 drivers/media/video/bt866.c: array overflows Adrian Bunk
2006-08-15  6:06 ` Martin Samuelsson
2006-08-15 18:13   ` Adrian Bunk
2006-08-15 21:04     ` Martin Samuelsson

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

all inboxes | Powered by JetHome®