Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/acpi CID/1325751: Avoid possible 32 bit overflow.



details:   https://anonhg.NetBSD.org/src/rev/b04f7685ccb6
branches:  trunk
changeset: 340856:b04f7685ccb6
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Oct 06 15:06:05 2015 +0000

description:
CID/1325751: Avoid possible 32 bit overflow.

diffstat:

 sys/arch/x86/acpi/acpi_machdep.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 638e5ee14ba0 -r b04f7685ccb6 sys/arch/x86/acpi/acpi_machdep.c
--- a/sys/arch/x86/acpi/acpi_machdep.c  Tue Oct 06 15:03:34 2015 +0000
+++ b/sys/arch/x86/acpi/acpi_machdep.c  Tue Oct 06 15:06:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.9 2015/10/02 05:22:52 msaitoh Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.10 2015/10/06 15:06:05 christos Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.9 2015/10/02 05:22:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2015/10/06 15:06:05 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -352,7 +352,8 @@
        if (bim == NULL)
                return false;
 
-       size = (*bus_end - bus_start + 1) * ACPIMCFG_SIZE_PER_BUS;
+       size = *bus_end - bus_start + 1;
+       size *= ACPIMCFG_SIZE_PER_BUS;
        for (i = 0; i < bim->num; i++) {
                mapaddr = bim->entry[i].addr;
                mapsize = bim->entry[i].size;



Home | Main Index | Thread Index | Old Index