summaryrefslogtreecommitdiffstats
path: root/Modules/binascii.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-07-11 18:36:28 (GMT)
committerGuido van Rossum <guido@python.org>1997-07-11 18:36:28 (GMT)
commit1243ae7f0767b5636ad1d071d15778f134f7c65f (patch)
treea7de7435850e727710b5676537b6abb11b11ad03 /Modules/binascii.c
parente3cd151d1f9b280217247d6e4f28932b96dc5322 (diff)
downloadcpython-1243ae7f0767b5636ad1d071d15778f134f7c65f.zip
cpython-1243ae7f0767b5636ad1d071d15778f134f7c65f.tar.gz
cpython-1243ae7f0767b5636ad1d071d15778f134f7c65f.tar.bz2
Allow '@' character as end of line padding in uuencode format.
Not sure why this is generated, but this fixes a problem with a particular file that was received with the following final line: F-WE<-*A5]AY]%7>8'&!!(_Y<F*55_"*%46"<OFG=>_5(F/\'``!@
Diffstat (limited to 'Modules/binascii.c')
-rw-r--r--Modules/binascii.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 4776170..7e03799 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -265,7 +265,9 @@ binascii_a2b_uu(self, args)
*/
while( ascii_len-- > 0 ) {
this_ch = *ascii_data++;
- if ( this_ch != ' ' && this_ch != '\n' && this_ch != '\r' ) {
+ /* Extra '@' may be written as padding in some cases */
+ if ( this_ch != ' ' && this_ch != '@' &&
+ this_ch != '\n' && this_ch != '\r' ) {
PyErr_SetString(Error, "Trailing garbage");
Py_DECREF(rv);
return NULL;