Catch two instances of untested regexp matches
They could possibly lead to the problems mentioned in https://github.com/OfflineIMAP/offlineimap/issues/6 though there are no sound evidences for this. Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
parent
69765a3ef0
commit
1ef506655c
@ -104,6 +104,8 @@ class MaildirFolder(BaseFolder):
|
||||
oldest_time_utc -= oldest_time_today_seconds
|
||||
|
||||
timestampmatch = re_timestampmatch.search(messagename)
|
||||
if not timestampmatch:
|
||||
return True
|
||||
timestampstr = timestampmatch.group()
|
||||
timestamplong = long(timestampstr)
|
||||
if(timestamplong < oldest_time_utc):
|
||||
|
@ -145,6 +145,10 @@ def imapsplit(imapstring):
|
||||
elif workstr[0] == '"':
|
||||
# quoted fragments '"...\"..."'
|
||||
m = quotere.match(workstr)
|
||||
if not m:
|
||||
raise ValueError ("failed to parse "
|
||||
"quoted component %s " % str(workstr) + \
|
||||
"while working with %s" % str(imapstring))
|
||||
retval.append(m.group('quote'))
|
||||
workstr = m.group('rest')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user