Skip to content

Commit 8cc2ba7

Browse files
authored
Merge pull request wolfSSL#8953 from philljj/fedora_linuxkm_uninit_errors
linuxkm fedora: fix uninitialized build errors.
2 parents fa9e122 + 9e811b5 commit 8cc2ba7

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

wolfcrypt/src/camellia.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ static int camellia_setup256(const unsigned char *key, u32 *subkey)
10221022
static int camellia_setup192(const unsigned char *key, u32 *subkey)
10231023
{
10241024
unsigned char kk[32];
1025-
u32 krll, krlr, krrl,krrr;
1025+
u32 krll = 0, krlr = 0, krrl = 0, krrr = 0;
10261026

10271027
XMEMCPY(kk, key, 24);
10281028
XMEMCPY((unsigned char *)&krll, key+16,4);

wolfcrypt/src/des3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@
16771677

16781678
static void DesProcessBlock(Des* des, const byte* in, byte* out)
16791679
{
1680-
word32 l, r;
1680+
word32 l = 0, r = 0;
16811681

16821682
XMEMCPY(&l, in, sizeof(l));
16831683
XMEMCPY(&r, in + sizeof(l), sizeof(r));
@@ -1700,7 +1700,7 @@
17001700

17011701
static void Des3ProcessBlock(Des3* des, const byte* in, byte* out)
17021702
{
1703-
word32 l, r;
1703+
word32 l = 0, r = 0;
17041704

17051705
XMEMCPY(&l, in, sizeof(l));
17061706
XMEMCPY(&r, in + sizeof(l), sizeof(r));

wolfcrypt/src/misc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,9 +1009,12 @@ WC_MISC_STATIC WC_INLINE void ato64(const byte *in, w64wrapper *w64)
10091009
#ifdef BIG_ENDIAN_ORDER
10101010
XMEMCPY(&w64->n, in, sizeof(w64->n));
10111011
#else
1012-
word64 _in;
1013-
XMEMCPY(&_in, in, sizeof(_in));
1014-
w64->n = ByteReverseWord64(_in);
1012+
union {
1013+
word64 w;
1014+
byte b[sizeof(word64)];
1015+
} _in;
1016+
XMEMCPY(_in.b, in, sizeof(_in));
1017+
w64->n = ByteReverseWord64(_in.w);
10151018
#endif /* BIG_ENDIAN_ORDER */
10161019
}
10171020

0 commit comments

Comments
 (0)