1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-11 13:14:25 +01:00

Fix bug#1138.

This commit is contained in:
Werner Koch 2009-09-28 17:11:10 +00:00
parent 011a15ecf0
commit cc88b024f6
2 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2009-09-28 Werner Koch <wk@g10code.com>
* trustdb.c (get_validity_info): Take care of a NULL PK. Fixes
bug#1138.
(get_validity_string): Ditto.
2009-09-25 Werner Koch <wk@g10code.com> 2009-09-25 Werner Koch <wk@g10code.com>
* pkglue.c (pk_sign, pk_verify, pk_encrypt, pk_decrypt) * pkglue.c (pk_sign, pk_verify, pk_encrypt, pk_decrypt)

View File

@ -1176,12 +1176,15 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid)
int int
get_validity_info (PKT_public_key *pk, PKT_user_id *uid) get_validity_info (PKT_public_key *pk, PKT_user_id *uid)
{ {
int trustlevel; int trustlevel;
trustlevel = get_validity (pk, uid); if (!pk)
if( trustlevel & TRUST_FLAG_REVOKED ) return '?'; /* Just in case a NULL PK is passed. */
return 'r';
return trust_letter ( trustlevel ); trustlevel = get_validity (pk, uid);
if ( (trustlevel & TRUST_FLAG_REVOKED) )
return 'r';
return trust_letter (trustlevel);
} }
const char * const char *
@ -1189,6 +1192,9 @@ get_validity_string (PKT_public_key *pk, PKT_user_id *uid)
{ {
int trustlevel; int trustlevel;
if (!pk)
return "err"; /* Just in case a NULL PK is passed. */
trustlevel = get_validity (pk, uid); trustlevel = get_validity (pk, uid);
if( trustlevel & TRUST_FLAG_REVOKED ) if( trustlevel & TRUST_FLAG_REVOKED )
return _("revoked"); return _("revoked");