Fix PeLoad function can't handle invalid PeImage to skip correct debug entry.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2253 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2007-01-16 06:30:16 +00:00
parent 2bbf72b0ab
commit 497ef745f0
2 changed files with 4 additions and 4 deletions

View File

@ -391,7 +391,7 @@ PeCoffLoaderGetImageInfo (
}
if (DebugDirectoryEntryFileOffset != 0) {
for (Index = 0; Index < DebugDirectoryEntry->Size; Index += Size) {
for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
//
// Read next debug directory entry
//
@ -479,7 +479,7 @@ PeCoffLoaderGetImageInfo (
}
if (DebugDirectoryEntryFileOffset != 0) {
for (Index = 0; Index < DebugDirectoryEntry->Size; Index += Size) {
for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
//
// Read next debug directory entry
//

View File

@ -346,7 +346,7 @@ Returns:
}
if (DebugDirectoryEntryFileOffset != 0) {
for (Index = 0; Index < (DebugDirectoryEntry->Size); Index += Size) {
for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
//
// Read next debug directory entry
//
@ -438,7 +438,7 @@ Returns:
}
if (DebugDirectoryEntryFileOffset != 0) {
for (Index = 0; Index < (DebugDirectoryEntry->Size); Index += Size) {
for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
//
// Read next debug directory entry
//