This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not crash on invalid size of dynamic section.
ClosedPublic

Authored by grimar on Oct 6 2016, 8:09 AM.

Details

Summary

Previously if sh_size of dynamic section was broken,
lld may crash. Or even may not crash if used 32 bits host.
(then value may be truncated to 32 bits when doing pointer arithmetic
and could be just zero).
Patch fixes the issue.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 73797.Oct 6 2016, 8:09 AM
grimar retitled this revision from to [ELF] - Do not crash on invalid size of dynamic section..
grimar updated this object.
grimar added reviewers: ruiu, rafael, davide.
grimar added subscribers: llvm-commits, grimar, evgeny777.
ruiu accepted this revision.Oct 6 2016, 11:11 AM
ruiu edited edge metadata.

LGTM

ELF/InputFiles.cpp
524 ↗(On Diff #73797)

getFilename(this) + ": getSectionContentsAsArray failed"

This revision is now accepted and ready to land.Oct 6 2016, 11:11 AM
This revision was automatically updated to reflect the committed changes.