diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index cfae3e6b2..4d9883836 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -671,8 +671,9 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck { std::cerr << " * Preferred * " << std::endl; userId = it->sslId; - userName = it->pgpName; + userName = it->pgpName; existingUser = true; + break; } } if (!existingUser) @@ -2079,7 +2080,7 @@ int RsServer::StartupRetroShare() /****** New Ft Server **** !!! */ ftserver = new ftServer(mPeerMgr, mLinkMgr); - ftserver->setP3Interface(pqih); + ftserver->setP3Interface(pqih); ftserver->setConfigDirectory(RsInitConfig::configDir); ftserver->SetupFtServer(&(getNotify())); diff --git a/openpgpsdk/src/packet-parse.c b/openpgpsdk/src/packet-parse.c index ad29c4b3a..84d4f193a 100644 --- a/openpgpsdk/src/packet-parse.c +++ b/openpgpsdk/src/packet-parse.c @@ -2107,21 +2107,22 @@ static int parse_literal_data(ops_region_t *region,ops_parse_info_t *pinfo) while(region->length_read < region->length) { - unsigned l=region->length-region->length_read; + unsigned l=region->length-region->length_read; - if(C.literal_data_body.data != NULL) - free(C.literal_data_body.data) ; + C.literal_data_body.data = (unsigned char *)malloc(l) ; - C.literal_data_body.data = (unsigned char *)malloc(l) ; + if(!limited_read(C.literal_data_body.data,l,region,pinfo)) + { + free(C.literal_data_body.data); + return 0; + } - if(!limited_read(C.literal_data_body.data,l,region,pinfo)) - return 0; + C.literal_data_body.length=l; - C.literal_data_body.length=l; + ops_parse_hash_data(pinfo,C.literal_data_body.data,l); - ops_parse_hash_data(pinfo,C.literal_data_body.data,l); - - CBP(pinfo,OPS_PTAG_CT_LITERAL_DATA_BODY,&content); + CBP(pinfo,OPS_PTAG_CT_LITERAL_DATA_BODY,&content); + free(C.literal_data_body.data); } return 1;