mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
fixed a few serialisation issues
This commit is contained in:
parent
96f3446aa7
commit
086b076477
@ -349,6 +349,12 @@ RsGRouterGenericDataItem *RsGRouterGenericDataItem::duplicate() const
|
||||
if(data_size > 0)
|
||||
{
|
||||
item->data_bytes = (uint8_t*)rs_malloc(data_size) ;
|
||||
|
||||
if(item->data_bytes == NULL)
|
||||
{
|
||||
delete item ;
|
||||
return NULL ;
|
||||
}
|
||||
memcpy(item->data_bytes,data_bytes,data_size) ;
|
||||
}
|
||||
else
|
||||
|
@ -284,16 +284,21 @@ RsTurtleRegExpSearchRequestItem::RsTurtleRegExpSearchRequestItem(void *data,uint
|
||||
uint32_t n =0 ;
|
||||
ok &= getRawUInt32(data,pktsize,&offset,&n) ;
|
||||
|
||||
expr._tokens.resize(n) ;
|
||||
if(ok)
|
||||
expr._tokens.resize(n) ;
|
||||
|
||||
for(uint32_t i=0;i<n && ok;++i) ok &= getRawUInt8(data,pktsize,&offset,&expr._tokens[i]) ;
|
||||
|
||||
ok &= getRawUInt32(data,pktsize,&offset,&n) ;
|
||||
expr._ints.resize(n) ;
|
||||
|
||||
if(ok)
|
||||
expr._ints.resize(n) ;
|
||||
|
||||
for(uint32_t i=0;i<n && ok;++i) ok &= getRawUInt32(data,pktsize,&offset,&expr._ints[i]) ;
|
||||
|
||||
ok &= getRawUInt32(data,pktsize,&offset,&n) ;
|
||||
ok &= getRawUInt32(data,pktsize,&offset,&n) ;
|
||||
|
||||
if(ok)
|
||||
expr._strings.resize(n) ;
|
||||
|
||||
for(uint32_t i=0;i<n && ok;++i) ok &= GetTlvString(data, pktsize, &offset, TLV_TYPE_STR_VALUE, expr._strings[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user