]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Clear OpenSSL errors on d2i_ASN1_OBJECT failures
authorMark Andrews <marka@isc.org>
Wed, 21 Jun 2023 11:30:15 +0000 (21:30 +1000)
committerMark Andrews <marka@isc.org>
Fri, 1 Sep 2023 02:01:19 +0000 (12:01 +1000)
When d2i_ASN1_OBJECT() fails an error is pushed onto the thread's
error stack.  This is now cleared by calling ERR_clear_error().

lib/dns/rdata.c

index 13218d069cb5519df04e98715eb975cae6aa14fa..45700291525fd3ff08a70dd5e68a04d5cc30e2db 100644 (file)
@@ -17,6 +17,7 @@
 #include <inttypes.h>
 #include <stdbool.h>
 
+#include <openssl/err.h>
 #include <openssl/objects.h>
 
 #include <isc/ascii.h>
@@ -623,6 +624,7 @@ check_private(isc_buffer_t *source, dns_secalg_t alg) {
                in = sr.base;
                obj = d2i_ASN1_OBJECT(NULL, &in, sr.length);
                if (obj == NULL) {
+                       ERR_clear_error();
                        RETERR(DNS_R_FORMERR);
                }
                ASN1_OBJECT_free(obj);