diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-10-10 11:15:38 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-10-10 11:15:38 +0000 |
commit | 067bb1f546efdb9cae33262b684aeb340798ff57 (patch) | |
tree | 3dd8cbda060d856d57ac2944501e293af8e223c3 /llvm/test/Analysis/LoopInfo | |
parent | eb8b6fe74525dbdc014f1f03881a77046a6cb052 (diff) | |
download | bcm5719-llvm-067bb1f546efdb9cae33262b684aeb340798ff57.tar.gz bcm5719-llvm-067bb1f546efdb9cae33262b684aeb340798ff57.zip |
[lldb] Fix out of bounds read in DataExtractor::GetCStr and add unit test that function.
Summary:
The `if (*cstr_end == '\0')` in the previous code checked if the previous loop terminated because it
found a null terminator or because it reached the end of the data. However, in the case that we hit
the end of the data before finding a null terminator, `cstr_end` points behind the last byte in our
data and `*cstr_end` reads the memory behind the array (which may be uninitialised)
This patch just rewrites that function use `std::find` and adds the relevant unit tests.
Reviewers: labath
Reviewed By: labath
Subscribers: abidh, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68773
llvm-svn: 374311
Diffstat (limited to 'llvm/test/Analysis/LoopInfo')
0 files changed, 0 insertions, 0 deletions