[pypy-commit] pypy default: fix for issue #1104, allow null bytes in certs

fijal noreply at buildbot.pypy.org
Mon Apr 2 07:51:20 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r54133:5bfd8e84f0f2
Date: 2012-04-02 07:50 +0200
http://bitbucket.org/pypy/pypy/changeset/5bfd8e84f0f2/

Log:	fix for issue #1104, allow null bytes in certs

diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -432,7 +432,8 @@
                     raise _ssl_seterror(self.space, self, length)
                 try:
                     # this is actually an immutable bytes sequence
-                    return self.space.wrap(rffi.charp2str(buf_ptr[0]))
+                    return self.space.wrap(rffi.charpsize2str(buf_ptr[0],
+                                                              length))
                 finally:
                     libssl_OPENSSL_free(buf_ptr[0])
         else:


More information about the pypy-commit mailing list