Skip to content

Commit 9e811b5

Browse files
committed
wolfcrypt misc: avoid frivolous initialization.
1 parent 9ac480a commit 9e811b5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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 = 0;
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)