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

SourceForge.net noreply at sourceforge.net
Sun Jun 6 16:07:10 EDT 2004


Bugs item #656392, was opened at 2002-12-19 12:20
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=656392&group_id=5470

Category: Python Library
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Grzegorz Makarewicz (makaron)
>Assigned to: Neal Norwitz (nnorwitz)
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)


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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2004-06-06 16:07

Message:
Logged In: YES 
user_id=33168

This problem appears to be fixed in Python 2.3+.

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

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



More information about the Python-bugs-list mailing list