From 62fce76130485773c635da8adaeb7de78382a5f0 Mon Sep 17 00:00:00 2001 From: "tb@openbsd.org" Date: Mon, 18 May 2026 04:14:57 +0000 Subject: [PATCH] upstream: chacha: avoid -Wunterminated-string-initialization warning The sizes of sigma[] and tau[] aren't used, so include a trailing NUL and thereby avoid upsetting modern compilers about use of dangerous, valid C. ok deraadt djm OpenBSD-Commit-ID: 030a71ff16bb1e6135170c6507bc558eabe7345c --- chacha.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chacha.c b/chacha.c index 9d79b661c..de79b3729 100644 --- a/chacha.c +++ b/chacha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chacha.c,v 1.2 2023/07/17 05:26:38 djm Exp $ */ +/* $OpenBSD: chacha.c,v 1.3 2026/05/18 04:14:57 tb Exp $ */ /* chacha-merged.c version 20080118 D. J. Bernstein @@ -48,8 +48,8 @@ typedef struct chacha_ctx chacha_ctx; a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \ c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); -static const char __attribute__ ((__nonstring__)) sigma[16] = "expand 32-byte k"; -static const char __attribute__ ((__nonstring__)) tau[16] = "expand 16-byte k"; +static const char sigma[] = "expand 32-byte k"; +static const char tau[] = "expand 16-byte k"; void chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits)