[Lldb-commits] [PATCH] D33853: Avoid invalid string access in ObjCLanguage::MethodName::SetName

Stephane Sezer via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 5 10:44:31 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL304725: Avoid invalid string access in ObjCLanguage::MethodName::SetName (authored by sas).

Changed prior to commit:
  https://reviews.llvm.org/D33853?vs=101284&id=101429#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33853

Files:
  lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp


Index: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
===================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
+++ lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
@@ -95,7 +95,7 @@
   // or '-' can be omitted
   bool valid_prefix = false;
 
-  if (name[0] == '+' || name[0] == '-') {
+  if (name.size() > 1 && (name[0] == '+' || name[0] == '-')) {
     valid_prefix = name[1] == '[';
     if (name[0] == '+')
       m_type = eTypeClassMethod;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33853.101429.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170605/0ad3669f/attachment.bin>


More information about the lldb-commits mailing list