summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-03-11 17:20:33 +0000
committermillert <millert@openbsd.org>2004-03-11 17:20:33 +0000
commit815ff87ddb73ce3a76923eb1290f1585f63debdc (patch)
tree4c942b1d950c2424a3f54c5914af033ba7a1ec55
parentAdd basic support for communities. Currently it is only possible to filter (diff)
downloadwireguard-openbsd-815ff87ddb73ce3a76923eb1290f1585f63debdc.tar.xz
wireguard-openbsd-815ff87ddb73ce3a76923eb1290f1585f63debdc.zip
Avoid a panic by checking for apm_code_len == 0. Fixes a problem
found by jmc@. OK markus@ and tom@
-rw-r--r--sys/arch/i386/i386/apm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index b601fcc0a16..fe90a90dd5a 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.60 2003/11/24 07:26:55 mickey Exp $ */
+/* $OpenBSD: apm.c,v 1.61 2004/03/11 17:20:33 millert Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@@ -740,7 +740,8 @@ apmprobe(parent, match, aux)
since pc* console and vga* probes much later
we cannot check for video memory being mapped
for apm stuff w/ bus_space_map() */
- if ((ap->apm_code32_base < IOM_BEGIN &&
+ if (ap->apm_code_len == 0 ||
+ (ap->apm_code32_base < IOM_BEGIN &&
ap->apm_code32_base + ap->apm_code_len > IOM_BEGIN) ||
(ap->apm_code16_base < IOM_BEGIN &&
ap->apm_code16_base + ap->apm_code16_len > IOM_BEGIN) ||