<div dir="ltr">I have some concerns about this change.<div><br></div><div>1.  strlcpy is not a C++ standard function, so it's not available for non-POSIX targets.  As far as I can tell, this is the first use of strlcpy in LLVM.</div><div><br></div><div>2.  In some of the changed calls, the buffer size argument still has a -1, which is redundant with what strlcpy is going to do, so this could cause strings to be truncated a char too soon.</div><div><br></div><div>3.  At some of the call sites, there remains now-redundant code to guarantee termination.. Since that's the point of changing these calls, we should probably eliminate that.</div><div><br></div><div>4.  I'm not familiar with this part of the code base.  Is it necessary for the APIs to work with pointer+length rather than a std::string (or other class) that would give us safety and portability?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 10, 2017 at 3:52 PM, Davide Italiano via lldb-commits <span dir="ltr"><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Dec 8, 2017 at 7:37 PM, Jason Molenda via lldb-commits<br>
<<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br>
> Author: jmolenda<br>
> Date: Fri Dec  8 19:37:09 2017<br>
> New Revision: 320242<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=320242&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=320242&view=rev</a><br>
> Log:<br>
> Change uses of strncpy in debugserver to strlcpy<br>
> for better safety.<br>
><br>
> <rdar://problem/32906923><br>
><br>
<br>
</span>Thanks!<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-commits</a><br>
</div></div></blockquote></div><br></div>