[Python-bugs-list] [ python-Bugs-665014 ] files with long lines and an encoding crash
SourceForge.net
noreply@sourceforge.net
Tue, 14 Jan 2003 15:18:18 -0800
Bugs item #665014, was opened at 2003-01-10 00:32
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=665014&group_id=5470
Category: Unicode
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 8
Submitted By: Mark Hammond (mhammond)
Assigned to: Mark Hammond (mhammond)
Summary: files with long lines and an encoding crash
Initial Comment:
If a source file declares an encoding, but has a line >
512 characters, a buffer overflows. debug builds
assert, but release builds trudge along.
Problem is that when reading an encoded line, the
'size' param is not passed to the underlying readline
function.
Attaching a test case and a patch.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2003-01-15 10:18
Message:
Logged In: YES
user_id=14198
Thanks.
/cvsroot/python/python/dist/src/Parser/tokenizer.c,v <--
tokenizer.c
new revision: 2.71; previous revision: 2.70
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2003-01-14 23:16
Message:
Logged In: YES
user_id=21627
I see. The patch is fine, please apply it.
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2003-01-14 22:21
Message:
Logged In: YES
user_id=14198
Test case already attached, as I mentioned. See crash.py.
Sorry, I should have mentioned the assertion failure is
inside the debug crt, which detects the 512 byte buffer
being overwritten due to the lack of a 'size' arg.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2003-01-14 19:25
Message:
Logged In: YES
user_id=21627
I can't reproduce this. What specific assertion failure do
you get, on what system (Windows, I guess)? Can you please
attach the test case?
----------------------------------------------------------------------
Comment By: M.-A. Lemburg (lemburg)
Date: 2003-01-10 00:54
Message:
Logged In: YES
user_id=38388
Assigned to Martin since he wrote the source code encoding
support.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=665014&group_id=5470