From: Juliusz Sosinowicz Date: Thu, 4 Apr 2024 18:16:10 +0000 (+0200) Subject: wolfssl: Fix get_x509_cert() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34914311c3a13deac3d83ef743c21b6bbecb7974;p=thirdparty%2Fhostap.git wolfssl: Fix get_x509_cert() The conditional was checking if data was not present. We should be allocating the buffer when data *is* present. Fixes: fec03f98383e ("Add support for wolfSSL cryptographic library") Signed-off-by: Juliusz Sosinowicz --- diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c index 539bdd317..0f7ea44f1 100644 --- a/src/crypto/tls_wolfssl.c +++ b/src/crypto/tls_wolfssl.c @@ -849,7 +849,7 @@ static struct wpabuf * get_x509_cert(WOLFSSL_X509 *cert) int cert_len; data = wolfSSL_X509_get_der(cert, &cert_len); - if (!data) + if (data) buf = wpabuf_alloc_copy(data, cert_len); return buf;