diff options
author | bde <bde@FreeBSD.org> | 1994-10-25 17:46:53 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1994-10-25 17:46:53 +0000 |
commit | c4b64391bfe03409e1e53efa97313d441ffa6cae (patch) | |
tree | 4495a8ed040bef9cb71932cdb8f0af672f9a1b8c /sbin/i386/fdisk | |
parent | e98634582e466672ac3a948bc014f1bb2534b2a3 (diff) | |
download | FreeBSD-src-c4b64391bfe03409e1e53efa97313d441ffa6cae.zip FreeBSD-src-c4b64391bfe03409e1e53efa97313d441ffa6cae.tar.gz |
Don't write outside of partp[] if the user gives an invalid partition
number for the partition to be made active. Do nothing instead. This
allows clearing all the active flags by specifying an invalid partition.
Diffstat (limited to 'sbin/i386/fdisk')
-rw-r--r-- | sbin/i386/fdisk/fdisk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c index cc8b564..f19eedb 100644 --- a/sbin/i386/fdisk/fdisk.c +++ b/sbin/i386/fdisk/fdisk.c @@ -397,7 +397,8 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts); while (!ok("Are you happy with this choice")); for (i = 0; i < NDOSPART; i++) partp[i].dp_flag = 0; - partp[active].dp_flag = ACTIVE; + if (active >= 0 && active < NDOSPART) + partp[active].dp_flag = ACTIVE; } get_params_to_use() |