summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-05-18 13:42:07 +0200
committerSimon Rettberg2018-05-18 13:42:07 +0200
commit38b804157124cad1fb7d936205216b212a0e3935 (patch)
tree3765ee1c315fd83af6d95e54a5720177eccf641b
parent4s timeout when connecting to server; send error to client on failure (diff)
downloadldadp-38b804157124cad1fb7d936205216b212a0e3935.tar.gz
ldadp-38b804157124cad1fb7d936205216b212a0e3935.tar.xz
ldadp-38b804157124cad1fb7d936205216b212a0e3935.zip
Fix use after free
-rw-r--r--openssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openssl.c b/openssl.c
index 8c107c2..84ab4de 100644
--- a/openssl.c
+++ b/openssl.c
@@ -151,8 +151,8 @@ BOOL ssl_checkCertificateHash(epoll_server_t *server)
if (server->serverData->fingerprint[i] != 0) {
unsigned char md[EVP_MAX_MD_SIZE];
unsigned int n = 20;
- X509_free(cert);
X509_digest(cert, sha1, md, &n);
+ X509_free(cert);
return n == 20 && memcmp(md, server->serverData->fingerprint, n) == 0;
}
}