Update of /cvsroot/mahogany/M/src/mail
In directory usw-pr-cvs1:/tmp/cvs-serv31267/src/mail

Modified Files:
        MessageCC.cpp 
Log Message:
fixed multiple potentially fatal bugs in base64 decoding

Index: MessageCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MessageCC.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -b -u -2 -r1.135 -r1.136
--- MessageCC.cpp       8 Sep 2002 19:23:11 -0000       1.135
+++ MessageCC.cpp       11 Sep 2002 23:59:39 -0000      1.136
@@ -937,5 +937,5 @@
                // we do *not* want to use the locale-specific settings here,
                // hence don't use isalpha()
-               unsigned char ch = *p;
+               const unsigned char ch = *p;
                if ( (ch >= 'A' && ch <= 'Z') ||
                      (ch >= 'a' && ch <= 'z') ||
@@ -949,7 +949,17 @@
                if ( ch == '=' )
                {
-                  // valid, but can only occur at the end as padding, so still
-                  // break below
                   p++;
+
+                  // valid, but can only occur at the end of data as padding,
+                  // so still break below -- but not before:
+
+                  // a) skipping a possible second '=' (can't be more than 2 of
+                  // them)
+                  if ( *p == '=' )
+                     p++;
+
+                  // b) skipping the terminating "\r\n"
+                  if ( p[0] == '\r' && p[1] == '\n' )
+                     p += 2;
                }
 



-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to