Commit 0ac60611 authored by Walter Dörwald's avatar Walter Dörwald

Backport checkin:

Fix a segfault when b"" was passed to b2a_qp() -- it was using strchr()
instead of memchr().
parent 6ca6f147
......@@ -1150,7 +1150,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
/* 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment