[PATCH 10/11] rijndael-ppc: fix 'may be used uninitialized' warnings

Jussi Kivilinna jussi.kivilinna at iki.fi
Sun Nov 3 20:56:54 CET 2024


* cipher/rijndael-ppc-common.h (PRELOAD_ROUND_KEYS_ALL): Load
rkey10-rkey13 with zero value by default.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 cipher/rijndael-ppc-common.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cipher/rijndael-ppc-common.h b/cipher/rijndael-ppc-common.h
index fc8ee526..bd2ad8b1 100644
--- a/cipher/rijndael-ppc-common.h
+++ b/cipher/rijndael-ppc-common.h
@@ -136,6 +136,7 @@ typedef union
 
 #define PRELOAD_ROUND_KEYS_ALL(nrounds) \
   do { \
+    static const block preload_zero = { 0 }; \
     rkey0 = ALIGNED_LOAD (rk, 0); \
     rkey1 = ALIGNED_LOAD (rk, 1); \
     rkey2 = ALIGNED_LOAD (rk, 2); \
@@ -146,6 +147,10 @@ typedef union
     rkey7 = ALIGNED_LOAD (rk, 7); \
     rkey8 = ALIGNED_LOAD (rk, 8); \
     rkey9 = ALIGNED_LOAD (rk, 9); \
+    rkey10 = preload_zero; \
+    rkey11 = preload_zero; \
+    rkey12 = preload_zero; \
+    rkey13 = preload_zero; \
     if (nrounds >= 12) \
       { \
 	rkey10 = ALIGNED_LOAD (rk, 10); \
-- 
2.45.2




More information about the Gcrypt-devel mailing list