From 6b4d582a8f2cc8af5df05b31ef6f7612399f654c Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 8 May 2017 06:27:21 +0200 Subject: errors.h: _gnutls_cert_log will only print on non-null certificates Signed-off-by: Nikos Mavrogiannopoulos --- lib/errors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/errors.h b/lib/errors.h index 7412a291f5..6ffc4172eb 100644 --- a/lib/errors.h +++ b/lib/errors.h @@ -61,7 +61,7 @@ void _gnutls_mpi_log(const char *prefix, bigint_t a); #define _gnutls_cert_log(str, cert) \ do { \ - if (unlikely(_gnutls_log_level >= 3)) { \ + if (unlikely(_gnutls_log_level >= 3 && cert != NULL)) { \ gnutls_datum_t _cl_out; int _cl_ret; \ _cl_ret = gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_ONELINE, &_cl_out); \ if (_cl_ret >= 0) { \ -- cgit v1.2.1