]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Change X509_STORE_up_ref() shim return value
authorArtem Boldariev <artem@boldariev.com>
Tue, 5 Apr 2022 10:33:40 +0000 (13:33 +0300)
committerArtem Boldariev <artem@boldariev.com>
Tue, 5 Apr 2022 12:03:27 +0000 (15:03 +0300)
X509_STORE_up_ref() must return 1 on success, while the previous
implementation would return the references count. This commit fixes
that.

lib/isc/openssl_shim.c

index 1dcc921f01e5a5fb32b5c12a8c2c99e59971e492..3d6cbeed89320a03f695ea9fcc62b365607f52e7 100644 (file)
@@ -174,7 +174,7 @@ OPENSSL_cleanup(void) {
 
 int
 X509_STORE_up_ref(X509_STORE *store) {
-       return (CRYPTO_add(&store->references, 1, CRYPTO_LOCK_X509_STORE));
+       return (CRYPTO_add(&store->references, 1, CRYPTO_LOCK_X509_STORE) > 0);
 }
 
 #endif /* !HAVE_OPENSSL_CLEANUP */