diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-10-29 22:46:43 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-10-29 22:46:43 +0000 |
commit | dc81dfb4888d8507991d39668fdbaabdb97aa708 (patch) | |
tree | 89eac9181d8fa4e13cdd77cfd396e1a1120fad86 /sys | |
parent | aea74c8d9efef3993074fcd12f3492ef9a663ebf (diff) |
Do not accept bad checksum lengths, bail out
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/dkcsum.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/dkcsum.c b/sys/arch/i386/i386/dkcsum.c index d7c44acd555..7834bd7058e 100644 --- a/sys/arch/i386/i386/dkcsum.c +++ b/sys/arch/i386/i386/dkcsum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dkcsum.c,v 1.4 1997/10/28 02:01:47 deraadt Exp $ */ +/* $OpenBSD: dkcsum.c,v 1.5 1997/10/29 22:46:42 niklas Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -69,8 +69,8 @@ dkcsumattach() u_int32_t csum; bios_diskinfo_t *bdi, *hit; - /* do nothing if no diskinfo passed from /boot */ - if (bios_diskinfo == NULL) + /* do nothing if no diskinfo passed from /boot, or a bad length */ + if (bios_diskinfo == NULL || bios_cksumlen * DEV_BSIZE > MAXBSIZE) return; /* |