diff options
| author | Jason Molenda <jmolenda@apple.com> | 2018-02-02 22:48:45 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2018-02-02 22:48:45 +0000 |
| commit | 37713073d65e473b6306b347a3f6e892128e27ca (patch) | |
| tree | d5fd06c50bfa72134b9dee7cbbea03d70655201c /lldb/source/Plugins/Process/elf-core | |
| parent | 7a64a3d59c2bbfd0d43a20b1443af95193e3e614 (diff) | |
| download | bcm5719-llvm-37713073d65e473b6306b347a3f6e892128e27ca.tar.gz bcm5719-llvm-37713073d65e473b6306b347a3f6e892128e27ca.zip | |
Fix a copy of a fixed length, possibly non-nul terminated, string
into a std::string so we don't run off the end of the array when
there is no nul byte in ProcessElfCore::parseLinuxNotes.
Found with ASAN testing.
<rdar://problem/37134319>
Differential revision: https://reviews.llvm.org/D42828
llvm-svn: 324156
Diffstat (limited to 'lldb/source/Plugins/Process/elf-core')
| -rw-r--r-- | lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index 7d6a0c9ad2d..7418c4f74ae 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -665,7 +665,7 @@ llvm::Error ProcessElfCore::parseLinuxNotes(llvm::ArrayRef<CoreNote> notes) { Status status = prpsinfo.Parse(note.data, arch); if (status.Fail()) return status.ToError(); - thread_data.name = prpsinfo.pr_fname; + thread_data.name.assign (prpsinfo.pr_fname, strnlen (prpsinfo.pr_fname, sizeof (prpsinfo.pr_fname))); SetID(prpsinfo.pr_pid); break; } |

