mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
check buffer size
This commit is contained in:
parent
8795f0c8c4
commit
cb91891f22
1 changed files with 6 additions and 0 deletions
|
@ -114,6 +114,12 @@ namespace data
|
||||||
{
|
{
|
||||||
uint8_t buf[50], signatureBuf[64];
|
uint8_t buf[50], signatureBuf[64];
|
||||||
size_t len = family.length (), signatureLen = strlen (signature);
|
size_t len = family.length (), signatureLen = strlen (signature);
|
||||||
|
if (len + 32 > 50)
|
||||||
|
{
|
||||||
|
LogPrint (eLogError, "Family: ", family, " is too long");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy (buf, family.c_str (), len);
|
memcpy (buf, family.c_str (), len);
|
||||||
memcpy (buf + len, (const uint8_t *)ident, 32);
|
memcpy (buf + len, (const uint8_t *)ident, 32);
|
||||||
len += 32;
|
len += 32;
|
||||||
|
|
Loading…
Add table
Reference in a new issue