Skip to content
Snippets Groups Projects
Commit 760fa362 authored by Adrien Béraud's avatar Adrien Béraud Committed by Adrien Béraud
Browse files

trust store: fix bad pointer access


gnutls_x509_trust_list_add_cas makes the trust list take ownership
of the certificate. The certificate is then destroyed by
gnutls_x509_trust_list_remove_cas.
At this point using existing shared_ptr<Certificate> pointing to this
structure will cause use of freed memory (bad pointer access).

To fix this we use new dht::crypto::Certificate method getCopy(),
that returns a raw gnutls certificate structure copy, to provide
to the trust list or any other APIs taking ownership of the object.

Change-Id: I6152ce0de5e463df01cfda0b18ef5c40a1739c2a
Tuleap: #1548
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 35550d22
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment