diff options
author | Jeffrey Walton <noloader@gmail.com> | 2020-05-11 12:49:15 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2020-05-11 12:49:15 -0400 |
commit | 53c03d2b3c10a24823da850c9f699f24f352b067 (patch) | |
tree | 504cfd3d9c0a06ea1f9abe0b3adb4738341d3323 /misc.h | |
parent | 353f26ecdca071426fd6fd37cd07951d7bd76f9a (diff) | |
download | cryptopp-git-53c03d2b3c10a24823da850c9f699f24f352b067.tar.gz |
Clean GCC 10 Analyzer warnings
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -525,7 +525,7 @@ inline void memcpy_s(void *dest, size_t sizeInBytes, const void *src, size_t cou # endif
#endif
if (src && dest)
- memcpy(dest, src, count);
+ std::memcpy(dest, src, count);
#if CRYPTOPP_MSC_VERSION
# pragma warning(pop)
#endif
@@ -569,7 +569,7 @@ inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t co # endif
#endif
if (src && dest)
- memmove(dest, src, count);
+ std::memmove(dest, src, count);
#if CRYPTOPP_MSC_VERSION
# pragma warning(pop)
#endif
@@ -2444,8 +2444,8 @@ inline T GetWord(bool assumeAligned, ByteOrder order, const byte *block) {
CRYPTOPP_UNUSED(assumeAligned);
- T temp;
- memcpy(&temp, block, sizeof(T));
+ T temp = 0;
+ if (block) {std::memcpy(&temp, block, sizeof(T));}
return ConditionalByteReverse(order, temp);
}
@@ -2488,8 +2488,8 @@ inline void PutWord(bool assumeAligned, ByteOrder order, byte *block, T value, c T t1, t2;
t1 = ConditionalByteReverse(order, value);
- if (xorBlock) {memcpy(&t2, xorBlock, sizeof(T)); t1 ^= t2;}
- memcpy(block, &t1, sizeof(T));
+ if (xorBlock) {std::memcpy(&t2, xorBlock, sizeof(T)); t1 ^= t2;}
+ if (block) {std::memcpy(block, &t1, sizeof(T));}
}
/// \brief Access a block of memory
|