[Lldb-commits] [EXTERNAL] [lldb] 42c906b - [lldb/API] Fix non null-terminated stop-reason in SBThread::GetStopDescription

Stella Stamenova via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 5 15:26:11 PST 2020


Does this fix the Windows failures that were reported this morning as well?

-----Original Message-----
From: lldb-commits <lldb-commits-bounces at lists.llvm.org> On Behalf Of Med Ismail Bennani via lldb-commits
Sent: Wednesday, February 5, 2020 3:21 PM
To: lldb-commits at lists.llvm.org
Subject: [EXTERNAL] [Lldb-commits] [lldb] 42c906b - [lldb/API] Fix non null-terminated stop-reason in SBThread::GetStopDescription


Author: Med Ismail Bennani
Date: 2020-02-06T00:20:33+01:00
New Revision: 42c906bceffaadeb704f2629d21f33aece831bc6

URL: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-project%2Fcommit%2F42c906bceffaadeb704f2629d21f33aece831bc6&data=02%7C01%7CSTILIS%40microsoft.com%7Cfe923584da414de18e0208d7aa920b36%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637165416541885593&sdata=u7KEb85cya75VP0tnQzix44dmAF%2FFE6SEeZ%2F7y4TT6g%3D&reserved=0
DIFF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-project%2Fcommit%2F42c906bceffaadeb704f2629d21f33aece831bc6.diff&data=02%7C01%7CSTILIS%40microsoft.com%7Cfe923584da414de18e0208d7aa920b36%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637165416541885593&sdata=VOQdODtElZsJKjAL56RaH5tZm6JEHqny7vlbxtueukI%3D&reserved=0

LOG: [lldb/API] Fix non null-terminated stop-reason in SBThread::GetStopDescription

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 at gmail.com>

Added: 
    

Modified: 
    lldb/source/API/SBThread.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index b215cddb4ca8..049a0b285e16 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -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);


        
_______________________________________________
lldb-commits mailing list
lldb-commits at lists.llvm.org
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flldb-commits&data=02%7C01%7CSTILIS%40microsoft.com%7Cfe923584da414de18e0208d7aa920b36%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637165416541885593&sdata=qZJ4iDBHeRC8xZcWJr4wNMIPLDBIxuWxDPsZoVp1rA0%3D&reserved=0


More information about the lldb-commits mailing list