Author: guido.van.rossum
Date: Wed May  9 19:55:11 2007
New Revision: 55204

Modified:
   python/branches/p3yk/Modules/binascii.c
Log:
Fix a segfault when b"" was passed to b2a_qp() -- it was using strchr()
instead of memchr().  Please backport; the original code was clearly wrong.


Modified: python/branches/p3yk/Modules/binascii.c
==============================================================================
--- python/branches/p3yk/Modules/binascii.c     (original)
+++ python/branches/p3yk/Modules/binascii.c     Wed May  9 19:55:11 2007
@@ -1150,7 +1150,7 @@
        /* XXX: this function has the side effect of converting all of
         * the end of lines to be the same depending on this detection
         * here */
-       p = (unsigned char *) strchr((char *)data, '\n');
+       p = (unsigned char *) memchr(data, '\n', datalen);
        if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
                crlf = 1;
 
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to