Source-Changes-HG archive

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

[src/trunk]: src/sys/kern CID-1427768: Off by one



details:   https://anonhg.NetBSD.org/src/rev/18709023b103
branches:  trunk
changeset: 829195:18709023b103
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 21 16:55:25 2018 +0000

description:
CID-1427768: Off by one

diffstat:

 sys/kern/subr_disk_mbr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ae6f89bd7da7 -r 18709023b103 sys/kern/subr_disk_mbr.c
--- a/sys/kern/subr_disk_mbr.c  Sun Jan 21 16:51:14 2018 +0000
+++ b/sys/kern/subr_disk_mbr.c  Sun Jan 21 16:55:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_disk_mbr.c,v 1.48 2018/01/07 03:35:43 christos Exp $      */
+/*     $NetBSD: subr_disk_mbr.c,v 1.49 2018/01/21 16:55:25 christos Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk_mbr.c,v 1.48 2018/01/07 03:35:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk_mbr.c,v 1.49 2018/01/21 16:55:25 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -724,7 +724,7 @@
        while (openmask != 0) {
                i = ffs(openmask) - 1;
                openmask &= ~(1 << i);
-               if (i > nlp->d_npartitions)
+               if (i >= nlp->d_npartitions)
                        return (EBUSY);
                opp = &olp->d_partitions[i];
                npp = &nlp->d_partitions[i];



Home | Main Index | Thread Index | Old Index