mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2025-02-21 13:53:43 +00:00
Cleared UBsan warnings under GCC 5.1
This commit is contained in:
parent
3a08e02f71
commit
427e1cf028
12
iterhash.cpp
12
iterhash.cpp
@ -27,7 +27,9 @@ template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte
|
||||
{
|
||||
if (num+len >= blockSize)
|
||||
{
|
||||
memcpy(data+num, input, blockSize-num);
|
||||
if(data && input)
|
||||
memcpy(data+num, input, blockSize-num);
|
||||
|
||||
HashBlock(dataBuf);
|
||||
input += (blockSize-num);
|
||||
len -= (blockSize-num);
|
||||
@ -36,7 +38,9 @@ template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(data+num, input, len);
|
||||
if(data && input)
|
||||
memcpy(data+num, input, len);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -59,7 +63,9 @@ template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte
|
||||
else
|
||||
do
|
||||
{ // copy input first if it's not aligned correctly
|
||||
memcpy(data, input, blockSize);
|
||||
if(data && input)
|
||||
memcpy(data, input, blockSize);
|
||||
|
||||
HashBlock(dataBuf);
|
||||
input+=blockSize;
|
||||
len-=blockSize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user