[issue18913] ssl._ssl._test_decode_cert seems to leak memory with certain certificates in Python 2.6

Matěj Stuchlík report at bugs.python.org
Tue Sep 3 17:48:32 CEST 2013


Matěj Stuchlík added the comment:

Potentially interesting part of the valgrind output:

==21685== 42,400 (3,200 direct, 39,200 indirect) bytes in 100 blocks are definitely lost in loss record 909 of 914
==21685==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==21685==    by 0x331B06315F: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e)
==21685==    by 0x331B0CD4EE: sk_new (in /usr/lib64/libcrypto.so.1.0.1e)
==21685==    by 0x331B0F2E42: ??? (in /usr/lib64/libcrypto.so.1.0.1e)
==21685==    by 0x331B0F2F7B: ??? (in /usr/lib64/libcrypto.so.1.0.1e)
==21685==    by 0x331B0F2884: ASN1_item_ex_d2i (in /usr/lib64/libcrypto.so.1.0.1e)
==21685==    by 0x331B0F3103: ASN1_item_d2i (in /usr/lib64/libcrypto.so.1.0.1e)
==21685==    by 0xB431892: _decode_certificate (_ssl.c:710)
==21685==    by 0xB431E57: PySSL_test_decode_certificate (_ssl.c:1025)
==21685==    by 0x49D187: PyEval_EvalFrameEx (ceval.c:3750)
==21685==    by 0x497A01: PyEval_EvalCodeEx (ceval.c:3000)
==21685==    by 0x497B41: PyEval_EvalCode (ceval.c:541)

_ssl.c:710 snippet:

(...)
 p = ext->value->data;
  if (method->it)
>     names = (GENERAL_NAMES*) (ASN1_item_d2i(NULL, &p, ext->value->length, ASN1_ITEM_ptr(method->it)));
  else
      names = (GENERAL_NAMES*) (method->d2i(NULL, &p, ext->value->length));
(...)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18913>
_______________________________________


More information about the Python-bugs-list mailing list