mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed missing error handling, causing unhandled exception
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7003 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3a567b2d6f
commit
99b9b53c62
@ -122,6 +122,7 @@ RsCertificate::RsCertificate(const std::string& str)
|
|||||||
dns_name(""),only_pgp(true)
|
dns_name(""),only_pgp(true)
|
||||||
{
|
{
|
||||||
uint32_t err_code ;
|
uint32_t err_code ;
|
||||||
|
binary_pgp_key = NULL ;
|
||||||
|
|
||||||
if(!initFromString(str,err_code) && !initFromString_oldFormat(str,err_code))
|
if(!initFromString(str,err_code) && !initFromString_oldFormat(str,err_code))
|
||||||
throw err_code ;
|
throw err_code ;
|
||||||
@ -176,6 +177,8 @@ void RsCertificate::scan_ip(const std::string& ip_string, unsigned short port,un
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RsCertificate::initFromString(const std::string& instr,uint32_t& err_code)
|
bool RsCertificate::initFromString(const std::string& instr,uint32_t& err_code)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
std::string str ;
|
std::string str ;
|
||||||
err_code = CERTIFICATE_PARSING_ERROR_NO_ERROR ;
|
err_code = CERTIFICATE_PARSING_ERROR_NO_ERROR ;
|
||||||
@ -313,6 +316,15 @@ bool RsCertificate::initFromString(const std::string& instr,uint32_t& err_code)
|
|||||||
delete[] bf ;
|
delete[] bf ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
catch(std::exception& e)
|
||||||
|
{
|
||||||
|
if(binary_pgp_key != NULL)
|
||||||
|
delete[] binary_pgp_key ;
|
||||||
|
|
||||||
|
err_code = CERTIFICATE_PARSING_ERROR_SIZE_ERROR ;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string RsCertificate::sslid_string() const
|
std::string RsCertificate::sslid_string() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user