summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-03-11 17:20:34 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-03-11 17:20:34 +0000
commit82275da0b8d88ff3d0c7857a568455186ddb4fa7 (patch)
tree26354508ffd518cbef6cf75697abd0b3c6ef4bb7 /sys/arch/i386
parentb21c2c568e1f969a0ca76f191c92856223ff303d (diff)
Avoid a panic by checking for apm_code_len == 0. Fixes a problem
found by jmc@. OK markus@ and tom@
Diffstat (limited to 'sys/arch/i386')
-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) ||