diff options
author | 1997-10-29 22:46:42 +0000 | |
---|---|---|
committer | 1997-10-29 22:46:42 +0000 | |
commit | 42bb0ea78d0338969476f0cc10bd413e9151a03d (patch) | |
tree | a8da90d4600759a490f705043f263751a44c5e79 | |
parent | clarify (diff) | |
download | wireguard-openbsd-42bb0ea78d0338969476f0cc10bd413e9151a03d.tar.xz wireguard-openbsd-42bb0ea78d0338969476f0cc10bd413e9151a03d.zip |
Do not accept bad checksum lengths, bail out
-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; /* |