[ARVADOS] updated: 3cc80b447efcaf416ea4d6857d6d40583e462ff8

git at public.curoverse.com git at public.curoverse.com
Wed Aug 13 14:06:45 EDT 2014


Summary of changes:
 sdk/python/arvados/collection.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

       via  3cc80b447efcaf416ea4d6857d6d40583e462ff8 (commit)
      from  dfda463f54b05a5fbc023077584d8681d9e6c96d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3cc80b447efcaf416ea4d6857d6d40583e462ff8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Aug 13 14:06:40 2014 -0400

    Fix degenerate case exponential runtime in regular expression use by
    CollectionReader to validate locators and manifests.  no issue #

diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index 0c8b620..8fdfcf8 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -93,10 +93,10 @@ def normalize(collection):
 
 class CollectionReader(object):
     def __init__(self, manifest_locator_or_text):
-        if re.search(r'^[a-f0-9]{32}(\+\d+)?(\+\S+)*$', manifest_locator_or_text):
+        if re.match(r'[a-f0-9]{32}(\+\d+)?(\+\S+)*$', manifest_locator_or_text):
             self._manifest_locator = manifest_locator_or_text
             self._manifest_text = None
-        elif re.search(r'^\S+( [a-f0-9]{32,}(\+\S+)*)*( \d+:\d+:\S+)+\n', manifest_locator_or_text):
+        elif re.match(r'(\S+)( [a-f0-9]{32}(\+\d+)(\+\S+)*)+( \d+:\d+:\S+)+', manifest_locator_or_text):
             self._manifest_text = manifest_locator_or_text
             self._manifest_locator = None
         else:

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list