kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darren Jenkins\\" <darrenrjenkins@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ][patch] fix array overflow in ak4114.c
Date: Wed, 12 Apr 2006 13:37:24 +0000	[thread overview]
Message-ID: <1144849044.8222.10.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

G'day list

Coverity found a static overflow in ak4114.c @ line 46.

After looking at this a little it seems like someone has typed in the
wrong symbolic name (twice), as they were trying to save the TX state
register info.


The patch below changes the relevant AK4114_REG_RXCSB0 values to
AK4114_REG_TXCSB0. Which both makes more sense and fixes the array
overflow.


Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>

--- 2.6.17-rc1-git5/sound/i2c/other/ak4114.c.orig	2006-04-12 23:12:43.000000000 +1000
+++ 2.6.17-rc1-git5/sound/i2c/other/ak4114.c	2006-04-12 23:16:56.000000000 +1000
@@ -42,8 +42,8 @@ static void reg_write(struct ak4114 *ak4
 	ak4114->write(ak4114->private_data, reg, val);
 	if (reg <= AK4114_REG_INT1_MASK)
 		ak4114->regmap[reg] = val;
-	else if (reg >= AK4114_REG_RXCSB0 && reg <= AK4114_REG_TXCSB4)
-		ak4114->txcsb[reg-AK4114_REG_RXCSB0] = val;
+	else if (reg >= AK4114_REG_TXCSB0 && reg <= AK4114_REG_TXCSB4)
+		ak4114->txcsb[reg-AK4114_REG_TXCSB0] = val;
 }
 
 static inline unsigned char reg_read(struct ak4114 *ak4114, unsigned char reg)



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2006-04-12 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12 13:37 Darren Jenkins\ [this message]
2006-04-13 10:29 ` [KJ][patch] fix array overflow in ak4114.c Jean Delvare

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=1144849044.8222.10.camel@localhost.localdomain \
    --to=darrenrjenkins@gmail.com \
    --cc=kernel-janitors@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).