Netdev List
 help / color / mirror / Atom feed
* [patch 1/1] irda: fix read buffer overflow
@ 2009-08-06 23:06 akpm
  2009-08-10  4:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2009-08-06 23:06 UTC (permalink / raw)
  To: samuel; +Cc: netdev, akpm, roel.kluin

From: Roel Kluin <roel.kluin@gmail.com>

io[i] is read before the bounds check on i, order should be reversed.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/irda/w83977af_ir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/irda/w83977af_ir.c~irda-fix-read-buffer-overflow drivers/net/irda/w83977af_ir.c
--- a/drivers/net/irda/w83977af_ir.c~irda-fix-read-buffer-overflow
+++ a/drivers/net/irda/w83977af_ir.c
@@ -115,7 +115,7 @@ static int __init w83977af_init(void)
 
 	IRDA_DEBUG(0, "%s()\n", __func__ );
 
-	for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) {
+	for (i=0; i < ARRAY_SIZE(dev_self) && io[i] < 2000; i++) {
 		if (w83977af_open(i, io[i], irq[i], dma[i]) == 0)
 			return 0;
 	}
_

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

end of thread, other threads:[~2009-08-10  4:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-06 23:06 [patch 1/1] irda: fix read buffer overflow akpm
2009-08-10  4:53 ` David Miller

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