[ldns-users] a bug in pyldns

Willem Toorop willem at NLnetLabs.nl
Fri Mar 18 08:36:40 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Bedrich,

Thank you for your patch.
I applied it to trunk.

Best regards,

Willem

On 03/16/11 20:21, Bedrich Kosata wrote:
> Hi everybody,
> 
> two of my students found another problem with the pyldns bindings. The
> function ldns.ldns_rr.new_frm_fp (ldns_rr_new_frm_fp_l_ in the raw
> wrapper) does not properly increment reference count on Py_None. This
> results in erroneous deallocation and after this function is used
> repeatedly for some time, the program crashes with "Fatal Python error:
> deallocating None" (the refcount for None reaches 0).
> This problem is remedied by the attached patch against ldns-1.6.9 (I am
> sorry I did not make it before the release :)). For good measure, I
> applied the same treatment to two other functions (ldns_rr_new_frm_str_,
> ldns_rr_new_question_frm_str_) where the same problem appeared.
> 
> With best regards
> 
> Beda
> 
> 
> p.s.- here is a simple test program to reproduce the crash in
> ldns_rr_new_frm_str_
> 
> -------------
> import ldns
> import sys
> 
> while True:
>   print sys.getrefcount(None)
>   ldns.ldns_rr.new_frm_str("www.nic.cz. IN A 192.168.1.1",300)
> -------------
> 
> In the fixed state, it should run indefinitely.
> 
> 
> 
> _______________________________________________
> ldns-users mailing list
> ldns-users at open.nlnetlabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNgxmYAAoJEOX4+CEvd6SY8I4P/Arl8kx2subSQ6G4BJAfekmO
yD0ofsyE5C2cJItN03GmHl56SouiGqARMWvzXHo4THfZhJ8Kyfj2EDqRas64x08B
w9me0XpRJXAO0/k9o8bbNyUijZv+D/dTPo7xeBWYRtb+F6mp9OzBN7PzAXAA7EwI
PRCGyIRQAzG6qP1qake00C+kcAYLndoG7h2azxBUT3fJ0VsaAinw0CNfoBG3lcdP
P917TgO1AjBc0TSxRHaqTJSAiewlSIZS16dowJylU3SAsCdg6LYPuONeFKuRuCkv
7GCqjoCW5pAGcBUkpCqN/hhbrAn00dt0nlKlVRPAc0gERwEEZfv/fzdaxA+P0HGc
bG1l/Mj+GUUMMelkt5yBm4u4StY1Jajb9Z6jNhG2eqMQ7Hz9Dvo+kqsR9t2I7pez
L6feuAJsFf2ht9Wq+vzQdTOn9OtTC2iD3auccZPpNYAjdKeaqaVk4K3nF7wZvD9C
8aso6kmRddN2oaM4geDJmjdiOmMRE0en8lLRRR0AySXIgNv4xal+jnNYyx0zkMG4
hx+Xjne/zruzDYO1vGwdK1w548yHsXPvTznXe3GJeUhPpBCYjUo4mODGdieqJq2U
MMl3rPMgz3alBH2FqBpl82PmAr3QPbWQ3QCIN+H+/EAkAx81FJ4rozX7if9GeFJW
DwJC5tRlKxWwiwDfqkGI
=K8Gt
-----END PGP SIGNATURE-----



More information about the ldns-users mailing list