From 108afdf1c36c38eb6a7ca89681fd98fef95f8461 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Thu, 11 Jun 2026 19:22:36 +0000 Subject: [PATCH] F-5633: use explicit NULL comparison in FreeCiphers Use the project's preferred `ptr != NULL` form for the new DTLS 1.3 ChaCha record-number zeroization guards instead of relying on truthiness. --- src/internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 36b0e0903c..8fd6e50db2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -3343,9 +3343,9 @@ void FreeCiphers(WOLFSSL* ssl) ssl->dtlsRecordNumberDecrypt.aes = NULL; #endif /* BUILD_AES */ #ifdef HAVE_CHACHA - if (ssl->dtlsRecordNumberEncrypt.chacha) + if (ssl->dtlsRecordNumberEncrypt.chacha != NULL) ForceZero(ssl->dtlsRecordNumberEncrypt.chacha, sizeof(ChaCha)); - if (ssl->dtlsRecordNumberDecrypt.chacha) + if (ssl->dtlsRecordNumberDecrypt.chacha != NULL) ForceZero(ssl->dtlsRecordNumberDecrypt.chacha, sizeof(ChaCha)); XFREE(ssl->dtlsRecordNumberEncrypt.chacha, ssl->heap, DYNAMIC_TYPE_CIPHER); XFREE(ssl->dtlsRecordNumberDecrypt.chacha, ssl->heap, DYNAMIC_TYPE_CIPHER);