When building with GCC-8 and enable-intelasm set, GCC reported a memcpy
from and two the same pointer being possible. Added a check for the same
pointer and skipped the copy if the same.
This commit is contained in:
John Safranek
2019-07-16 15:44:45 -07:00
parent c3c705f82b
commit 9c245b7fc5

View File

@ -1628,7 +1628,8 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock)
#endif
/* if input and output same will overwrite input iv */
XMEMCPY(aes->tmp, inBlock, AES_BLOCK_SIZE);
if ((const byte*)aes->tmp != inBlock)
XMEMCPY(aes->tmp, inBlock, AES_BLOCK_SIZE);
AES_ECB_decrypt(inBlock, outBlock, AES_BLOCK_SIZE, (byte*)aes->key,
aes->rounds);
return;