From e69a06299978b99051fc078ac3bc46c77f0d5821 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Fri, 1 Aug 2008 23:21:43 +0000 Subject: [PATCH] Use ReadUnaligned32() instead of CopyMem() git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5605 6f19259b-4bc3-4df7-8a09-765794883524 --- .../BaseUefiTianoCustomDecompressLib.c | 4 ++-- .../BaseUefiTianoCustomDecompressLib.inf | 1 + .../BaseUefiTianoCustomDecompressLibInternals.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c index dc5511e0c5..3a1888d073 100644 --- a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c +++ b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c @@ -584,13 +584,13 @@ UefiDecompressGetInfo ( return RETURN_INVALID_PARAMETER; } - CompressedSize = *(UINT32 *) Source; + CompressedSize = ReadUnaligned32 ((UINT32 *)Source); if (SourceSize < (CompressedSize + 8)) { return RETURN_INVALID_PARAMETER; } *ScratchSize = sizeof (SCRATCH_DATA); - *DestinationSize = *((UINT32 *) Source + 1); + *DestinationSize = ReadUnaligned32 ((UINT32 *)Source + 1); return RETURN_SUCCESS; } diff --git a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf index 746d42c2ae..9cc71bcca4 100644 --- a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf +++ b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf @@ -41,6 +41,7 @@ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec [LibraryClasses] + BaseLib DebugLib BaseMemoryLib ExtractGuidedSectionLib diff --git a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLibInternals.h b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLibInternals.h index a1eb9d587c..d2695fa469 100644 --- a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLibInternals.h +++ b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLibInternals.h @@ -19,6 +19,7 @@ #include +#include #include #include #include