From dda9d4eca5862e42213069cdfc547a2877038636 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 27 Nov 2013 20:37:24 +0000 Subject: [PATCH] do not accept keys without a uid. Previously this was crashing RS git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6912 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pgp/pgphandler.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index 060227ea4..bc8bb3e9b 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -693,6 +693,11 @@ bool PGPHandler::getGPGDetailsFromBinaryBlock(const unsigned char *mem_block,siz std::cerr << "No or incomplete/invalid key in supplied pgp block." << std::endl; return false ; } + if(tmp_keyring->keys[0].uids == NULL) + { + std::cerr << "No uid in supplied key." << std::endl; + return false ; + } key_id = PGPIdType(tmp_keyring->keys[0].key_id).toStdString() ; name = std::string((char *)tmp_keyring->keys[0].uids[0].user_id) ;