From b40913e80c993dbd518134c333198ae338d6335d Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 25 Jul 2024 15:25:32 -0500 Subject: [PATCH] wolfcrypt/src/random.c: restore outer cast in array_add() to avoid -Wconversion added in b28e22aef0, itself a fix for a defect added in ed11669f3c (root cause of warning is implicit type promotion). --- wolfcrypt/src/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 061ea6b9b2..822f069f7f 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -594,7 +594,7 @@ static WC_INLINE void array_add(byte* d, word32 dLen, const byte* s, word32 sLen dIdx = (int)dLen - 1; for (sIdx = (int)sLen - 1; sIdx >= 0; sIdx--) { - carry += (word16)d[dIdx] + (word16)s[sIdx]; + carry += (word16)((word16)d[dIdx] + (word16)s[sIdx]); d[dIdx] = (byte)carry; carry >>= 8; dIdx--;