diff mbox series

crypto: lib/aescfb - fix build with GCC 15 due to -Werror=unterminated-string-initialization

Message ID 20250301143842.173872-1-mpagano@gentoo.org
State New
Headers show
Series crypto: lib/aescfb - fix build with GCC 15 due to -Werror=unterminated-string-initialization | expand

Commit Message

Mike Pagano March 1, 2025, 2:38 p.m. UTC
Fix char length error which appears when compiling with GCC 15:

CC      lib/crypto/aescfb.o
lib/crypto/aescfb.c:124:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
124 |                 .ptext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/aescfb.c:132:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
132 |                 .ctext  = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/aescfb.c:148:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
148 |                 .ptext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/aescfb.c:156:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
156 |                 .ctext  = "\xcd\xc8\x0d\x6f\xdd\xf1\x8c\xab"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/aescfb.c:166:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
166 |                 .key    = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/aescfb.c:173:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
173 |                 .ptext  = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/aescfb.c:181:27: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
181 |                 .ctext  = "\xdc\x7e\x84\xbf\xda\x79\x16\x4b"
    |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Mike Pagano <mpagano@gentoo.org>
---
 lib/crypto/aescfb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/lib/crypto/aescfb.c b/lib/crypto/aescfb.c
index 749dc1258..9db2ef86d 100644
--- a/lib/crypto/aescfb.c
+++ b/lib/crypto/aescfb.c
@@ -106,11 +106,11 @@  MODULE_LICENSE("GPL");
  */
 
 static struct {
-	u8	ptext[64];
-	u8	ctext[64];
+	u8	ptext[65];
+	u8	ctext[65];
 
-	u8	key[AES_MAX_KEY_SIZE];
-	u8	iv[AES_BLOCK_SIZE];
+	u8	key[AES_MAX_KEY_SIZE+1];
+	u8	iv[AES_BLOCK_SIZE+1];
 
 	int	klen;
 	int	len;