Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Fix ASAN issues #1453

Merged
merged 3 commits into from
Apr 8, 2019
Merged

Fix ASAN issues #1453

merged 3 commits into from
Apr 8, 2019

Conversation

adrian-prantl
Copy link
Member

rdar://problem/49698580

adrian-prantl and others added 3 commits April 8, 2019 14:57
the input StringRef is not guaranteed to be null-terminated, so using
data to get the c string is wrong. Luckily, in two of the usages the
target function already accepts a StringRef so we can just drop the
data() call, and the third one is easily replaced by a stringref-aware
function.

Issue found by msan.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@355817 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit dae6031)
llvm::StringRef host_and_port is not guaranteed to be null-terminated.
Generally, it is not safe at all to convert a StringRef into a char *
by calling data() on it.

<rdar://problem/49698580>

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@357948 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit d41c00f)
@adrian-prantl
Copy link
Member Author

@swift-ci test and merge

@swift-ci swift-ci merged commit c96bb9c into apple:swift-5.1-branch Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants