[COFF] Add a bounds checking helper for iterating a coff_resource_dir_table
commit013811b39598c2b24ba007040e28ed5ba3339a4e
authorMartin Storsjo <martin@martin.st>
Thu, 29 Aug 2019 08:59:56 +0000 (29 08:59 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 29 Aug 2019 08:59:56 +0000 (29 08:59 +0000)
treee90bba442fb977047f72b11a17942040a47c6b48
parent6fcee0361888f874715dc2f77e88f91f2c700919
[COFF] Add a bounds checking helper for iterating a coff_resource_dir_table

Instead of blindly incrementing pointers in llvm-readobj, use this
helper, which does bounds checking against the available section
data.

Differential Revision: https://reviews.llvm.org/D66818

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370310 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/COFF.h
lib/Object/COFFObjectFile.cpp
tools/llvm-readobj/COFFDumper.cpp