Skip to content

Commit

Permalink
[lldb/API] Fix non null-terminated stop-reason in SBThread::GetStopDe…
Browse files Browse the repository at this point in the history
…scription

When trying to get the stop reason description using the SB API, the
buffer fetched was not null-terminated causing failures on the sanitized bot.

This patch should address those failures.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
  • Loading branch information
medismailben committed Feb 5, 2020
1 parent bab9934 commit 42c906b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lldb/source/API/SBThread.cpp
Expand Up @@ -326,7 +326,7 @@ size_t SBThread::GetStopDescription(char *dst, size_t dst_len) {
StopInfoSP stop_info_sp = exe_ctx.GetThreadPtr()->GetStopInfo();
if (stop_info_sp) {
const char *stop_desc =
exe_ctx.GetThreadPtr()->GetStopDescription().data();
exe_ctx.GetThreadPtr()->GetStopDescription().c_str();
if (stop_desc) {
if (dst)
return ::snprintf(dst, dst_len, "%s", stop_desc);
Expand Down

0 comments on commit 42c906b

Please sign in to comment.