VirtualBox

Changeset 58513 in vbox


Ignore:
Timestamp:
Oct 30, 2015 12:41:16 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103834
Message:

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c: BdsLibGetImageHeader: Dunno what someone was smoking here - how can DosHeaders be NULL? Anyway, reduced the mess a little by simplifying the seemingly pointless fAnalyzeDosHeader changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c

    r58466 r58513  
    408408  FreePool (TempOptionPtr);
    409409  FreePool (OptionOrderPtr);
    410 
    411410  VBoxLogFlowFuncLeaveRC(Status);
    412411  return Status;
     
    12921291  Status = ThisFile->Read (ThisFile, &BufferSize, DosHeader);
    12931292  VBoxLogFlowFuncMarkRC(Status);
    1294   if (
    1295 #ifdef VBOX
    1296        fAnalyzeDosHeader &&
     1293#ifdef VBOX /** @todo r=bird: It's anyone's wild guess wtf we do this here...
     1294             * I mean, the read should fail if DosHeader is NULL, right?
     1295             * So, why don't we just get rid of this non-sense? */
     1296 if (fAnalyzeDosHeader)
     1297 {
    12971298#endif
    1298          (   EFI_ERROR (Status)
    1299           || BufferSize < sizeof (EFI_IMAGE_DOS_HEADER)
    1300           || FileSize <= DosHeader->e_lfanew
    1301           || DosHeader->e_magic != EFI_IMAGE_DOS_SIGNATURE)) {
     1299  if (EFI_ERROR (Status) ||
     1300      BufferSize < sizeof (EFI_IMAGE_DOS_HEADER) ||
     1301      FileSize <= DosHeader->e_lfanew ||
     1302      DosHeader->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
    13021303    Status = EFI_LOAD_ERROR;
    13031304    VBoxLogFlowFuncMarkRC(Status);
     
    13051306  }
    13061307
    1307 #ifdef VBOX
    1308     if (fAnalyzeDosHeader)
    1309  {
    1310 #endif
    13111308  //
    13121309  // Move to PE signature
     
    13441341  }
    13451342#ifdef VBOX
    1346     }
     1343 }
    13471344#endif
    13481345
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette