]> granicus.if.org Git - python/commitdiff
Allow '@' character as end of line padding in uuencode format.
authorGuido van Rossum <guido@python.org>
Fri, 11 Jul 1997 18:36:28 +0000 (18:36 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 11 Jul 1997 18:36:28 +0000 (18:36 +0000)
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/\'``!@

Modules/binascii.c

index 477617075560bdbc6fe3ba567b0fd547de379edd..7e03799126682658cd1f7f990da03d5b106beb46 100644 (file)
@@ -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;