Cleared UBsan warnings under GCC 5.1
parent
3a08e02f71
commit
427e1cf028
|
|
@ -27,7 +27,9 @@ template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte
|
|||
{
|
||||
if (num+len >= blockSize)
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
if(data && input)
|
||||
memcpy(data, input, blockSize);
|
||||
|
||||
HashBlock(dataBuf);
|
||||
input+=blockSize;
|
||||
len-=blockSize;
|
||||
|
|
|
|||
Loading…
Reference in New Issue