[Python-bugs-list] [ python-Bugs-656392 ] binascii.a2b_base64 with non base64 data

noreply@sourceforge.net noreply@sourceforge.net
Thu, 19 Dec 2002 09:20:42 -0800


Bugs item #656392, was opened at 2002-12-19 18:20
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=656392&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Grzegorz Makarewicz (makaron)
Assigned to: Nobody/Anonymous (nobody)
Summary: binascii.a2b_base64 with non base64 data

Initial Comment:

python 2.2.2 or cvs, platform any

binascii.a2b_base64 allocates buffer for data at
startup, at end data it truncated to decoded size if it
is bigger than 0, but what about invalid data where
every character is non base64 - space, \r,\n ?

Buffer remains allocated to bin_len but resulting data
length is 0 and it isnt truncated as random data will
be returned

demo.py
import base64
data = '\n'
result = base64.decodestring(data)
print map(ord,result)


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

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