commit | 715a63b78349952ccc0fb3dd3139e2d822006d35 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Sat Jul 21 00:52:06 2012 +0200 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Sat Jul 21 00:52:06 2012 +0200 |
tree | d1474f149df204365adc6c07ba57469753124145 | |
parent | bee739baa771b7c54169e799fbfe1a55c5fce3d6 [diff] [blame] |
Issue #14579: Fix error handling bug in the utf-16 decoder. Patch by Serhiy Storchaka.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7af7b50..59b138a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c
@@ -2564,7 +2564,7 @@ } /* UTF-16 code pair: */ - if (q >= e) { + if (e - q < 2) { errmsg = "unexpected end of data"; startinpos = (((const char *)q)-2)-starts; endinpos = ((const char *)e)-starts;