VirtualBox

Changeset 60450 in vbox


Ignore:
Timestamp:
Apr 12, 2016 11:49:23 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106537
Message:

ldrELFRelocatable.cpp.h: Fixed incorrect st_shndx validation. Used symbol count instead of section count.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h

    r56978 r60450  
    250250        else
    251251        {
    252             AssertMsgReturn(pSym->st_shndx < pModElf->cSyms || pSym->st_shndx == SHN_ABS, ("%#x\n", pSym->st_shndx),
     252            AssertMsgReturn(pSym->st_shndx < pModElf->Ehdr.e_shnum || pSym->st_shndx == SHN_ABS, ("%#x\n", pSym->st_shndx),
    253253                            VERR_LDRELF_INVALID_RELOCATION_OFFSET);
    254254#if   ELF_MODE == 64
     
    258258
    259259#if   ELF_MODE == 64
    260         /* Calc the value. */
     260        /* Calc the value (indexes checked above; assumes SHN_UNDEF == 0). */
    261261        Elf_Addr Value;
    262         if (pSym->st_shndx < pModElf->cSyms)
     262        if (pSym->st_shndx < pModElf->Ehdr.e_shnum)
    263263            Value = SymValue + offDelta;
    264         else
     264        else /* SHN_ABS: */
    265265            Value = SymValue + paRels[iRel].r_addend;
    266266#endif
Note: See TracChangeset for help on using the changeset viewer.

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