mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Martin Samuelsson <sam@home.se>, mchehab@infradead.org
Cc: v4l-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org
Subject: drivers/media/video/bt866.c: array overflows
Date: Tue, 15 Aug 2006 01:23:37 +0200	[thread overview]
Message-ID: <20060814232337.GZ3543@stusta.de> (raw)

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


             reply	other threads:[~2006-08-14 23:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14 23:23 Adrian Bunk [this message]
2006-08-15  6:06 ` Martin Samuelsson
2006-08-15 18:13   ` Adrian Bunk
2006-08-15 21:04     ` Martin Samuelsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060814232337.GZ3543@stusta.de \
    --to=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=sam@home.se \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®