summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/rfc822.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 662703b..7030ee7 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -553,10 +553,11 @@ class AddrlistClass:
# address is a group
returnlist = []
+ fieldlen = len(self.field)
self.pos = self.pos + 1
while self.pos < len(self.field):
self.gotonext()
- if self.field[self.pos] == ';':
+ if self.pos < fieldlen and self.field[self.pos] == ';':
self.pos = self.pos + 1
break
returnlist = returnlist + self.getaddress()