mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 00:49:41 -05:00
early check of too long group names (currently disabled)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8126 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2f2d01dc41
commit
e75b28b733
@ -160,6 +160,18 @@ bool RsGxsGrpMetaData::deserialise(void *data, uint32_t &pktsize)
|
|||||||
ok &= signSet.GetTlv(data, pktsize, &offset);
|
ok &= signSet.GetTlv(data, pktsize, &offset);
|
||||||
ok &= keys.GetTlv(data, pktsize, &offset);
|
ok &= keys.GetTlv(data, pktsize, &offset);
|
||||||
|
|
||||||
|
#ifdef DROP_NON_CANONICAL_ITEMS
|
||||||
|
if(mGroupName.length() > RsGxsGrpMetaData::MAX_ALLOWED_STRING_SIZE)
|
||||||
|
{
|
||||||
|
std::cerr << "WARNING: Deserialised group with mGroupName.length() = " << mGroupName.length() << ". This is not allowed. This item will be dropped." << std::endl;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
if(mServiceString.length() > RsGxsGrpMetaData::MAX_ALLOWED_STRING_SIZE)
|
||||||
|
{
|
||||||
|
std::cerr << "WARNING: Deserialised group with mServiceString.length() = " << mGroupName.length() << ". This is not allowed. This item will be dropped." << std::endl;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ class RsMsgMetaData;
|
|||||||
class RsGxsGrpMetaData
|
class RsGxsGrpMetaData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static const int MAX_ALLOWED_STRING_SIZE = 50 ;
|
||||||
|
|
||||||
RsGxsGrpMetaData();
|
RsGxsGrpMetaData();
|
||||||
bool deserialise(void *data, uint32_t &pktsize);
|
bool deserialise(void *data, uint32_t &pktsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user