friss added inline comments.

================
Comment at: lldb/source/Utility/UUID.cpp:66-67
   uuid_bytes.clear();
   while (!p.empty()) {
-    if (isxdigit(p[0]) && isxdigit(p[1])) {
+    if (p.size() >= 2 && isxdigit(p[0]) && isxdigit(p[1])) {
       int hi_nibble = xdigit_to_int(p[0]);
----------------
labath wrote:
> I guess now obsoletes Fred's D80807.
> 
> (Btw, I actually liked how Fred's solution rejects strings which end in a 
> trailing dash.)
Yeah, I didn't have a strong opinion before, but given we want to reject a 
buffer that isn't parsed completely, I think it's better to reject a buffer 
ending with a `-`. As the code would test `p.size()` anyway, we might as well 
use `p.size() >= 2 ` as the loop condition.

Otherwise this LGTM. Thanks!


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

https://reviews.llvm.org/D80755



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to