summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-09 02:11:57 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-09 02:11:57 (GMT)
commit92d8917f8300267e798df729cf4f28acd83f257f (patch)
tree102d47f605dd23625e27f81e584e074e9cdec380
parentdcf5715db180e09e2ce150e42ce3a6fb4b1b1888 (diff)
downloadcpython-92d8917f8300267e798df729cf4f28acd83f257f.zip
cpython-92d8917f8300267e798df729cf4f28acd83f257f.tar.gz
cpython-92d8917f8300267e798df729cf4f28acd83f257f.tar.bz2
Address a bug in the uuencode decoder, reported bu "donut" in SF bug
#127718: '@' and '`' seem to be confused.
-rw-r--r--Modules/binascii.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 010e22d..85edd04 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -204,7 +204,7 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
/* Check the character for legality
** The 64 in stead of the expected 63 is because
** there are a few uuencodes out there that use
- ** '@' as zero instead of space.
+ ** '`' as zero instead of space.
*/
if ( this_ch < ' ' || this_ch > (' ' + 64)) {
PyErr_SetString(Error, "Illegal char");
@@ -232,8 +232,8 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
*/
while( ascii_len-- > 0 ) {
this_ch = *ascii_data++;
- /* Extra '@' may be written as padding in some cases */
- if ( this_ch != ' ' && this_ch != '@' &&
+ /* Extra '`' may be written as padding in some cases */
+ if ( this_ch != ' ' && this_ch != ' '+64 &&
this_ch != '\n' && this_ch != '\r' ) {
PyErr_SetString(Error, "Trailing garbage");
Py_DECREF(rv);