fixed a few things to correct PR403

This commit is contained in:
csoler 2016-06-02 20:23:22 -04:00
parent 699b3cf064
commit 10e0254317
8 changed files with 59 additions and 19 deletions

View file

@ -133,6 +133,12 @@ public:
uint32_t rssize = getRsItemSize(data);
bool ok = true ;
if(rssize > size)
{
std::cerr << __PRETTY_FUNCTION__ << ": error while deserialising! Item will be dropped." << std::endl;
return NULL ;
}
/* add mandatory parts first */
ok &= getRawUInt32(data, rssize, &offset, &item->mServiceId);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_NAME, item->mServiceName);