[Python-checkins] python/dist/src/Modules binascii.c,2.40,2.41
nnorwitz at users.sourceforge.net
nnorwitz at users.sourceforge.net
Sun Jun 6 16:13:12 EDT 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10720/Modules
Modified Files:
binascii.c
Log Message:
Valgrind was reporting an uninitialized read for bad input.
This fixes the problem and the test passes. I'm not sure
the test is really correct though. It seems like it would
be better to raise an exception. I think that wasn't done
for backwards compatability.
Bugfix candidate.
Index: binascii.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/binascii.c,v
retrieving revision 2.40
retrieving revision 2.41
diff -C2 -d -r2.40 -r2.41
*** binascii.c 11 May 2004 02:05:11 -0000 2.40
--- binascii.c 6 Jun 2004 20:13:10 -0000 2.41
***************
*** 205,209 ****
for( ; bin_len > 0 ; ascii_len--, ascii_data++ ) {
! this_ch = *ascii_data;
if ( this_ch == '\n' || this_ch == '\r' || ascii_len <= 0) {
/*
--- 205,210 ----
for( ; bin_len > 0 ; ascii_len--, ascii_data++ ) {
! /* XXX is it really best to add NULs if there's no more data */
! this_ch = (ascii_len > 0) ? *ascii_data : 0;
if ( this_ch == '\n' || this_ch == '\r' || ascii_len <= 0) {
/*
More information about the Python-checkins
mailing list