summaryrefslogtreecommitdiffstats
path: root/Lib/html
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2014-02-01 19:21:01 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2014-02-01 19:21:01 (GMT)
commitf27b9a741ac7771aa1f6c1219d86a61222fdc20a (patch)
tree517d3d39e33b79607e4135bdf1811a2ff908ccd1 /Lib/html
parenta479b7505e88947dd8eff82b6bff604636287893 (diff)
downloadcpython-f27b9a741ac7771aa1f6c1219d86a61222fdc20a.zip
cpython-f27b9a741ac7771aa1f6c1219d86a61222fdc20a.tar.gz
cpython-f27b9a741ac7771aa1f6c1219d86a61222fdc20a.tar.bz2
#20288: fix handling of invalid numeric charrefs in HTMLParser.
Diffstat (limited to 'Lib/html')
-rw-r--r--Lib/html/parser.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 2d3bef3..63fe774 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -228,9 +228,9 @@ class HTMLParser(_markupbase.ParserBase):
i = self.updatepos(i, k)
continue
else:
- if ";" in rawdata[i:]: #bail by consuming &#
- self.handle_data(rawdata[0:2])
- i = self.updatepos(i, 2)
+ if ";" in rawdata[i:]: # bail by consuming &#
+ self.handle_data(rawdata[i:i+2])
+ i = self.updatepos(i, i+2)
break
elif startswith('&', i):
match = entityref.match(rawdata, i)