From 546dbe16258f25b5efa6f02c36697a223b4bd980 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sun, 30 Jun 2024 01:09:11 +1000 Subject: [PATCH] lib\x509\verify-high: Fix compilation with msvc /sdl. --- lib/x509/verify-high.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/x509/verify-high.c b/lib/x509/verify-high.c index aacc24a7d8..3562e741f9 100644 --- a/lib/x509/verify-high.c +++ b/lib/x509/verify-high.c @@ -1423,7 +1423,8 @@ int gnutls_x509_trust_list_verify_crt2( } /* Allocate extra for retrieved certificates. */ - if (!INT_ADD_OK(cert_list_size, DEFAULT_MAX_VERIFY_DEPTH, + size_t size = DEFAULT_MAX_VERIFY_DEPTH; + if (!INT_ADD_OK(cert_list_size, size, &cert_list_max_size)) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);