-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Hello maintainers,
When building Crypto++ with clang22 (flags: -DNDEBUG -g2 -O3 -fPIC -fno-devirtualize -pthread -pipe), I observed a fortify/stringop-overflow warning from memcpy at compilation of esign.cpp. I would appreciate your advice or triage for this warning.
Warning excerpt:
In file included from /usr/include/string.h:548,
from /usr/include/c++/14/cstring:43,
from stdcpp.h:63,
from cryptlib.h:106,
from esign.h:10,
from esign.cpp:11:
In function 'void* memcpy(void*, const void*, size_t)',
inlined from 'virtual void CryptoPP::InvertibleESIGNFunction::GenerateRandom(CryptoPP::RandomNumberGenerator&, const CryptoPP::NameValuePairs&)' at esign.cpp:115:14:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' specified bound 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
29 | return __builtin___memcpy_chk (__dest, __src, __len,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
30 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' specified bound 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
Context & Source:
- Source file:
esign.cpp@ commit 843d74c7 - Potentially relevant code:
if (param.GetValue("Seed", seedParam))
{
seed.resize(seedParam.size() + 4);
std::memcpy(seed + 4, seedParam.begin(), seedParam.size());
// ...
}(see full file: esign.cpp)
- Pipeline reproduction:
cryptobench-cppbuild log here - Compilation flags used: clang22 -DNDEBUG -g2 -O3 -fPIC -fno-devirtualize -pthread -pipe
Notes:
- I have not investigated the root cause.
- I am not proposing a patch at this time; this is a tracking/triage report.
Steps to reproduce:
- Build Crypto++ with clang22 and the flags listed above.
- Observe the warning in the compilation output for esign.cpp.
Many thanks for your attention!
Metadata
Metadata
Assignees
Labels
No labels