mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #2128 from PhenomRetroShare/Fix_RsItemDeserialiseTooSmall
Fix rs item deserialise too small
This commit is contained in:
commit
b820057064
@ -33,11 +33,16 @@
|
||||
|
||||
RsItem *RsServiceSerializer::deserialise(void *data, uint32_t *size)
|
||||
{
|
||||
if(!data || !size || !*size)
|
||||
if(!data || !size || *size < 8)
|
||||
{
|
||||
RsErr() << __PRETTY_FUNCTION__ << " Called with null paramethers data: "
|
||||
<< data << " size: " << static_cast<void*>(size) << " *size: "
|
||||
<< (size ? *size : 0) << " this should never happen!"
|
||||
RsErr() << __PRETTY_FUNCTION__ << " Called with inconsistent parameters data: " << std::endl;
|
||||
if(data)
|
||||
RsErr() << "Data is: " << RsUtil::BinToHex(static_cast<uint8_t*>(data),std::min(50u,*size)) << ((*size>50)?"...":"") << std::endl;
|
||||
else
|
||||
RsErr() << "Null Data" << std::endl;
|
||||
|
||||
RsErr() << " size: " << static_cast<void*>(size) << " *size: " << (size ? *size : 0) << std::endl
|
||||
<< " this should never happen!"
|
||||
<< std::endl;
|
||||
print_stacktrace();
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user