mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-20 14:20:59 +00:00
catch ValueError, raise IncompleteRead on invalid chunk length
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1250 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
9e65a336ef
commit
fefba0036d
1 changed files with 4 additions and 1 deletions
|
|
@ -423,7 +423,10 @@ class HTTPResponse:
|
|||
i = line.find(';')
|
||||
if i >= 0:
|
||||
line = line[:i] # strip chunk-extensions
|
||||
chunk_left = int(line, 16)
|
||||
try:
|
||||
chunk_left = int(line, 16)
|
||||
except ValueError, msg:
|
||||
raise IncompleteRead(msg)
|
||||
if chunk_left == 0:
|
||||
break
|
||||
if amt is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue