Fix pqiSSLstore::encryptedSendItems empty list

RsTemporaryMemory was complaining of being initialized with size 0 in
case of empty list was passed to the method, this is a legitimate use
case when one want have an empty list as state, so in this case pass 1
as argument to RsTemporaryMemory constructor
This commit is contained in:
Gioacchino Mazzurco 2017-02-25 23:09:46 +01:00
parent 828792f2b5
commit 748e75d3e1

View File

@ -394,10 +394,9 @@ bool pqiSSLstore::encryptedSendItems(const std::list<RsItem*>& rsItemList)
uint32_t offset = 0;
for(it = rsItemList.begin(); it != rsItemList.end(); ++it)
if(*it != NULL)
sizeItems += rsSerialiser->size(*it);
if(*it != NULL) sizeItems += rsSerialiser->size(*it);
RsTemporaryMemory data(sizeItems) ;
RsTemporaryMemory data( sizeItems ? sizeItems : 1 );
for(it = rsItemList.begin(); it != rsItemList.end(); ++it)
if(*it != NULL)