[Lldb-commits] [lldb] r182607 - <rdar://problem/13966084>

Greg Clayton gclayton at apple.com
Thu May 23 13:27:15 PDT 2013


Author: gclayton
Date: Thu May 23 15:27:15 2013
New Revision: 182607

URL: http://llvm.org/viewvc/llvm-project?rev=182607&view=rev
Log:
<rdar://problem/13966084>

Make sure to not call "regexec" from <regex.h> with a NULL C string, otherwise we can crash.


Modified:
    lldb/trunk/source/Core/RegularExpression.cpp

Modified: lldb/trunk/source/Core/RegularExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegularExpression.cpp?rev=182607&r1=182606&r2=182607&view=diff
==============================================================================
--- lldb/trunk/source/Core/RegularExpression.cpp (original)
+++ lldb/trunk/source/Core/RegularExpression.cpp Thu May 23 15:27:15 2013
@@ -129,7 +129,7 @@ bool
 RegularExpression::Execute(const char* s, Match *match, int execute_flags) const
 {
     int err = 1;
-    if (m_comp_err == 0)
+    if (s != NULL && m_comp_err == 0)
     {
         if (match)
         {





More information about the lldb-commits mailing list