]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Don't crash if gnutls_x509_crt_list_import() fails
authorOmar Sandoval <osandov@osandov.com>
Tue, 27 Aug 2019 16:27:51 +0000 (09:27 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 3 Sep 2019 15:46:30 +0000 (16:46 +0100)
commit0859d68f6eb42c7b0b5b9872fd333fd1dd184242
tree8625e297bc9152ed3c468f41f886bde94e38fe09
parent5b0ea32e69aa6e864aecaadb243cf9f164d9d4a4
Don't crash if gnutls_x509_crt_list_import() fails

On error, gnutls_x509_crt_list_import() deinitializes any certificates
that it loaded (this isn't documented, of course, but see [1]). However,
we're also deinitializing them in the error handling case, resulting in
a double-free. Set nr_extra_certs to zero in that case so that we don't
crash.

1: https://gitlab.com/gnutls/gnutls/blob/gnutls_3_6_9/lib/x509/x509.c#L3864

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
gnutls.c