From a785c1cf31026ec7056caba4cb109ebd1875a420 Mon Sep 17 00:00:00 2001 From: aystarik Date: Wed, 29 Jun 2005 16:09:51 +0000 Subject: [PATCH] Check for > 7 Vendor bytes date 2004.12.08.22.53.00; author rmoore1; state Exp; --- source/compiler/aslrestype1.c | 19 +++++++++++++++++-- source/compiler/asltypes.h | 8 +++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c index 47446b6eb..58e996c07 100644 --- a/source/compiler/aslrestype1.c +++ b/source/compiler/aslrestype1.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: aslrestype1 - Short (type1) resource templates and descriptors - * $Revision: 1.27 $ + * $Revision: 1.28 $ * *****************************************************************************/ @@ -1041,8 +1041,23 @@ RsDoVendorSmallDescriptor ( * Process all child initialization nodes */ InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); - for (i = 0; (InitializerOp && (i < 7)); i++) + for (i = 0; InitializerOp; i++) { + /* Maximum 7 vendor data bytes allowed (0-6) */ + + if (i >= 7) + { + AslError (ASL_ERROR, ASL_MSG_VENDOR_LIST, InitializerOp, NULL); + + /* Eat the excess initializers */ + + while (InitializerOp) + { + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + break; + } + Descriptor->Smv.VendorDefined[i] = (UINT8) InitializerOp->Asl.Value.Integer; InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); } diff --git a/source/compiler/asltypes.h b/source/compiler/asltypes.h index a6beaaa33..a5225f059 100644 --- a/source/compiler/asltypes.h +++ b/source/compiler/asltypes.h @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: asltypes.h - compiler data types and struct definitions - * $Revision: 1.67 $ + * $Revision: 1.68 $ * *****************************************************************************/ @@ -396,7 +396,8 @@ typedef enum ASL_MSG_INVALID_UUID, ASL_MSG_INTERRUPT_LIST, ASL_MSG_DMA_CHANNEL, - ASL_MSG_DMA_LIST + ASL_MSG_DMA_LIST, + ASL_MSG_VENDOR_LIST } ASL_MESSAGE_IDS; @@ -492,7 +493,8 @@ char *AslMessages [] = { /* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", /* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (255 max)", /* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)", -/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)" +/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)", +/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)" };