[Patches] [ python-Patches-665458 ] Crash in binascii_a2b_uu on corrupt data

SourceForge.net noreply@sourceforge.net
Thu, 09 Jan 2003 18:44:19 -0800


Patches item #665458, was opened at 2003-01-10 03:44
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=665458&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Scharf (scharf)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash in binascii_a2b_uu on corrupt data

Initial Comment:
When I unpacked 50 gigabytes of randomly downloaded 
usenet binary news posts python crashed (randomly) on 
windows. After long tracking (I did'nt have a debug 
version) I found the problem in binascii_a2b_uu:

When reading the input data, the boundaries of the input 
sting are not checked. With corrupted uuencoded data 
(the first bite gives the length of the encoded string), the 
function reads out of bounds of the input string. That is 
not a problem (in most cases) but sometimes (it 
happened typicallyafter 20-30 gibagytes of parsed data) 
the allocated string might be at the end of a 
memory 'segment' and there is no string after the 
allocated string. And that causes a crash.

I have attached a patch to solve the problem. (Python 
2.2.2)

Michael

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=665458&group_id=5470