Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Fixes from OpenBSD:



details:   https://anonhg.NetBSD.org/src/rev/1386867ccd5b
branches:  trunk
changeset: 545621:1386867ccd5b
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Apr 12 06:11:15 2003 +0000

description:
Fixes from OpenBSD:
- Fix index bounds checking in save data pointers logic.
- Fix an indent problem and an extra blank space.

diffstat:

 sys/dev/ic/osiop.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r d7413dbb5479 -r 1386867ccd5b sys/dev/ic/osiop.c
--- a/sys/dev/ic/osiop.c        Sat Apr 12 05:01:01 2003 +0000
+++ b/sys/dev/ic/osiop.c        Sat Apr 12 06:11:15 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: osiop.c,v 1.11 2003/02/18 16:42:40 tsutsui Exp $       */
+/*     $NetBSD: osiop.c,v 1.12 2003/04/12 06:11:15 tsutsui Exp $       */
 
 /*
  * Copyright (c) 2001 Izumi Tsutsui.  All rights reserved.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.11 2003/02/18 16:42:40 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.12 2003/04/12 06:11:15 tsutsui Exp $");
 
 /* #define OSIOP_DEBUG */
 
@@ -1390,7 +1390,7 @@
                                n = (n - Ent_dataout) / 16;
                        else
                                n = (n - Ent_datain) / 16;
-                       if (n <= 0 && n > OSIOP_NSG)
+                       if (n < 0 || n >= OSIOP_NSG)
                                printf("TEMP invalid %ld\n", n);
                        else {
                                acb->curaddr = ds->data[n].addr;
@@ -1452,10 +1452,12 @@
                            i < OSIOP_NSG && ds->data[i].count > 0;
                            i++, j++) {
 #ifdef OSIOP_DEBUG
-                       if (osiop_debug & DEBUG_DISC)
-                               printf("  chain[%d]: %x/%x -> %x/%x\n", j,
-                                   ds->data[j].addr, ds->data[j].count,
-                                   ds->data[i].addr, ds->data[i].count);
+                               if (osiop_debug & DEBUG_DISC)
+                                       printf("  chain[%d]: %x/%x -> %x/%x\n",
+                                           j, ds->data[j].addr,
+                                           ds->data[j].count,
+                                           ds->data[i].addr,
+                                           ds->data[i].count);
 #endif
                                ds->data[j].addr  = ds->data[i].addr;
                                ds->data[j].count = ds->data[i].count;



Home | Main Index | Thread Index | Old Index