diff options
author | Bob Haarman <llvm@inglorion.net> | 2017-12-18 22:10:14 +0000 |
---|---|---|
committer | Bob Haarman <llvm@inglorion.net> | 2017-12-18 22:10:14 +0000 |
commit | b43be724f7c7af0e2adec9649728d414b0ea0b2b (patch) | |
tree | 5a32012634c04863cdac123f0cff35d5933ede11 /utils | |
parent | f56fea260f543b35f0047093844574470dead426 (diff) |
Fix buffer overrun in WindowsResourceCOFFWriter::writeSymbolTable()
Summary:
We were using sprintf(..., "$R06X", <some uint32_t>) to create strings
that are expected to be exactly length 8, but this results in longer
strings if the uint32_t is greater than 0xffffff. This change modifies
the behavior as follows:
- Uses the loop counter instead of the data offset. This gives us
sequential symbol names, avoiding collisions as much as possible.
- Masks the value to 0xffffff to avoid generating names longer than 8
bytes.
- Uses formatv instead of sprintf.
Fixes PR35581.
Reviewers: ruiu, zturner
Reviewed By: ruiu
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D41270
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
0 files changed, 0 insertions, 0 deletions