mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Patch from AsamK to avoid crash when no uids are present in the key. How can this happen anyway?
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5535 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9049440253
commit
15caadff6b
@ -50,7 +50,10 @@ ops_parse_cb_return_t cb_get_passphrase(const ops_parser_content_t *content_,ops
|
|||||||
case OPS_PARSER_CMD_GET_SK_PASSPHRASE:
|
case OPS_PARSER_CMD_GET_SK_PASSPHRASE:
|
||||||
{
|
{
|
||||||
std::string passwd;
|
std::string passwd;
|
||||||
std::string uid_hint = std::string((const char *)cbinfo->cryptinfo.keydata->uids[0].user_id) ;
|
std::string uid_hint ;
|
||||||
|
|
||||||
|
if(cbinfo->cryptinfo.keydata->nuids > 0)
|
||||||
|
uid_hint = std::string((const char *)cbinfo->cryptinfo.keydata->uids[0].user_id) ;
|
||||||
uid_hint += "(" + PGPIdType(cbinfo->cryptinfo.keydata->key_id).toStdString()+")" ;
|
uid_hint += "(" + PGPIdType(cbinfo->cryptinfo.keydata->key_id).toStdString()+")" ;
|
||||||
|
|
||||||
passwd = PGPHandler::passphraseCallback()(NULL,uid_hint.c_str(),NULL,prev_was_bad) ;
|
passwd = PGPHandler::passphraseCallback()(NULL,uid_hint.c_str(),NULL,prev_was_bad) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user