[Lldb-commits] [lldb] r272423 - Fixed a few places that were building a regex from an identifier without escaping the identifier text.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 10 13:09:33 PDT 2016


Author: gclayton
Date: Fri Jun 10 15:09:33 2016
New Revision: 272423

URL: http://llvm.org/viewvc/llvm-project?rev=272423&view=rev
Log:
Fixed a few places that were building a regex from an identifier without escaping the identifier text.

<rdar://problem/26090553> 

Modified:
    lldb/trunk/examples/python/crashlog.py
    lldb/trunk/examples/python/symbolication.py

Modified: lldb/trunk/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=272423&r1=272422&r2=272423&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Fri Jun 10 15:09:33 2016
@@ -452,7 +452,7 @@ class CrashLog(symbolication.Symbolicato
         for image in self.images:
             if image.identifier == identifier:
                 return image            
-        regex_text = '^.*\.%s$' % (identifier)
+        regex_text = '^.*\.%s$' % (re.escape(identifier))
         regex = re.compile(regex_text)
         for image in self.images:
             if regex.match(image.identifier):

Modified: lldb/trunk/examples/python/symbolication.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolication.py?rev=272423&r1=272422&r2=272423&view=diff
==============================================================================
--- lldb/trunk/examples/python/symbolication.py (original)
+++ lldb/trunk/examples/python/symbolication.py Fri Jun 10 15:09:33 2016
@@ -448,7 +448,7 @@ class Symbolicator:
             if image.identifier == identifier:
                 images.append(image)
         if len(images) == 0:
-            regex_text = '^.*\.%s$' % (identifier)
+            regex_text = '^.*\.%s$' % (re.escape(identifier))
             regex = re.compile(regex_text)
             for image in self.images:
                 if regex.match(image.identifier):




More information about the lldb-commits mailing list