[Lldb-commits] [PATCH] D72086: [lldb] Fix that SBThread.GetStopDescription is returning strings with uninitialized memory at the end.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 6 06:33:06 PST 2020


labath added a reviewer: jingham.
labath added a comment.

Would it be possible to fix this problem in the swig bindings instead? (i.e. move the `std::min` stuff into the swig code). That way, the behavior of this function will at least match that of snprintf, which will hopefully be less surprising that what you've done here. (And it will also fix the inconsistency noticed by @shafik).



================
Comment at: lldb/source/API/SBThread.cpp:337
+          }
           else {
             // NULL dst passed in, return the length needed to contain the
----------------
shafik wrote:
> The `else` branch feels inconsistent with the change above. Especially the `+ 1`.
yep


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72086/new/

https://reviews.llvm.org/D72086





More information about the lldb-commits mailing list