Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sbin/disklabel Pull up revision 1.20 (requested by gran...



details:   https://anonhg.NetBSD.org/src/rev/d7dc7a7ef7e9
branches:  netbsd-1-6
changeset: 528293:d7dc7a7ef7e9
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat Jun 29 23:13:52 2002 +0000

description:
Pull up revision 1.20 (requested by grant in ticket #402):
disallow creation of partitions which start beyond (or extend beyond)
the end of the disk.

diffstat:

 sbin/disklabel/interact.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 81fdec8cfc95 -r d7dc7a7ef7e9 sbin/disklabel/interact.c
--- a/sbin/disklabel/interact.c Sat Jun 29 22:48:11 2002 +0000
+++ b/sbin/disklabel/interact.c Sat Jun 29 23:13:52 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interact.c,v 1.19 2001/10/19 01:16:38 lukem Exp $      */
+/*     $NetBSD: interact.c,v 1.19.2.1 2002/06/29 23:13:52 lukem Exp $  */
 
 /*
  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: interact.c,v 1.19 2001/10/19 01:16:38 lukem Exp $");
+__RCSID("$NetBSD: interact.c,v 1.19.2.1 2002/06/29 23:13:52 lukem Exp $");
 #endif /* lint */
 
 #include <sys/param.h>
@@ -482,6 +482,9 @@
                if ((i = getnum(lp, line, 0)) == -1) {
                        printf("Bad offset `%s'\n", line);
                        continue;
+               } else if (i > lp->d_secperunit) {
+                       printf("Offset `%s' out of range\n", line);
+                       continue;
                }
                p->p_offset = i;
                break;
@@ -498,6 +501,10 @@
                    == -1) {
                        printf("Bad size `%s'\n", line);
                        continue;
+               } else if
+                   ((i + p->p_offset) > lp->d_secperunit) {
+                       printf("Size `%s' out of range\n", line);
+                       continue;
                }
                p->p_size = i;
                break;



Home | Main Index | Thread Index | Old Index