From d8063b913ee68b6fb20f43ce611c18a0d9dd50b6 Mon Sep 17 00:00:00 2001 From: Can Erkin Acar Date: Mon, 29 May 2006 00:43:57 +0000 Subject: Fix a memory overrun in the aml parser code. ok deraadt@, gwk@ --- sys/dev/acpi/dsdt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index b24c9acb72b..36996877c21 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.41 2006/04/21 23:03:04 joris Exp $ */ +/* $OpenBSD: dsdt.c,v 1.42 2006/05/29 00:43:56 canacar Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -1549,8 +1549,9 @@ aml_efield(struct acpi_context *ctx, struct aml_value *e_fld, } rv = aml_val2buf(ctx, rhs, blen); - aml_bufcpy(pb, e_fld->v_field.bitpos, rv->v_buffer, 0, - e_fld->v_field.bitlen); + + aml_bufcpy(pb, aml_bitpos(e_fld->v_field.bitpos), + rv->v_buffer, 0, e_fld->v_field.bitlen); if (rv != rhs) aml_freevalue(&rv); -- cgit v1.2.3