From 1fef733cc7f33adaabdb7becc9c03fab2f41b8a3 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 13 Feb 2009 05:20:55 +0000 Subject: Fix security check. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7519 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 71e92399f4..f07c107412 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -123,8 +123,8 @@ GetWorker ( VariableHead = (VARIABLE_HEAD *) (PcdDb + Offset); - Guid = &(GuidTable[VariableHead->GuidTableIndex]); - Name = &(StringTable[VariableHead->StringIndex]); + Guid = GuidTable + VariableHead->GuidTableIndex; + Name = StringTable + VariableHead->StringIndex; VaraiableDefaultBuffer = (UINT8 *) PcdDb + VariableHead->DefaultValueOffset; Status = GetHiiVariable (Guid, Name, &Data, &DataSize); @@ -154,7 +154,7 @@ GetWorker ( case PCD_TYPE_STRING: StringTableIdx = (UINT16) *((UINT8 *) PcdDb + Offset); - RetPtr = (VOID *) &StringTable[StringTableIdx]; + RetPtr = (VOID *) (StringTable + StringTableIdx); break; case PCD_TYPE_DATA: @@ -774,7 +774,7 @@ SetWorker ( case PCD_TYPE_STRING: if (SetPtrTypeSize (TmpTokenNumber, Size)) { - CopyMem (&StringTable[*((UINT16 *)InternalData)], Data, *Size); + CopyMem (StringTable + *((UINT16 *)InternalData), Data, *Size); Status = EFI_SUCCESS; } else { Status = EFI_INVALID_PARAMETER; @@ -794,8 +794,8 @@ SetWorker ( VariableHead = (VARIABLE_HEAD *) (PcdDb + Offset); - Guid = &(GuidTable[VariableHead->GuidTableIndex]); - Name = &(StringTable[VariableHead->StringIndex]); + Guid = GuidTable + VariableHead->GuidTableIndex; + Name = StringTable + VariableHead->StringIndex; VariableOffset = VariableHead->Offset; Status = SetHiiVariable (Guid, Name, Data, *Size, VariableOffset); -- cgit v1.2.3