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:
csoler 2015-04-09 19:55:56 +00:00
parent 2f2d01dc41
commit e75b28b733
2 changed files with 13 additions and 0 deletions

View File

@ -160,6 +160,18 @@ bool RsGxsGrpMetaData::deserialise(void *data, uint32_t &pktsize)
ok &= signSet.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;
}

View File

@ -40,6 +40,7 @@ class RsMsgMetaData;
class RsGxsGrpMetaData
{
public:
static const int MAX_ALLOWED_STRING_SIZE = 50 ;
RsGxsGrpMetaData();
bool deserialise(void *data, uint32_t &pktsize);