[svn] GnuPG - r5165 - branches/STABLE-BRANCH-2-0/g10
svn author wk
cvs at cvs.gnupg.org
Mon Sep 28 19:11:11 CEST 2009
Author: wk
Date: 2009-09-28 19:11:10 +0200 (Mon, 28 Sep 2009)
New Revision: 5165
Modified:
branches/STABLE-BRANCH-2-0/g10/ChangeLog
branches/STABLE-BRANCH-2-0/g10/trustdb.c
Log:
Fix bug#1138.
Modified: branches/STABLE-BRANCH-2-0/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/ChangeLog 2009-09-28 14:37:48 UTC (rev 5164)
+++ branches/STABLE-BRANCH-2-0/g10/ChangeLog 2009-09-28 17:11:10 UTC (rev 5165)
@@ -1,3 +1,9 @@
+2009-09-28 Werner Koch <wk at 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 at g10code.com>
* pkglue.c (pk_sign, pk_verify, pk_encrypt, pk_decrypt)
Modified: branches/STABLE-BRANCH-2-0/g10/trustdb.c
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/trustdb.c 2009-09-28 14:37:48 UTC (rev 5164)
+++ branches/STABLE-BRANCH-2-0/g10/trustdb.c 2009-09-28 17:11:10 UTC (rev 5165)
@@ -1176,12 +1176,15 @@
int
get_validity_info (PKT_public_key *pk, PKT_user_id *uid)
{
- int trustlevel;
-
- trustlevel = get_validity (pk, uid);
- if( trustlevel & TRUST_FLAG_REVOKED )
- return 'r';
- return trust_letter ( trustlevel );
+ int trustlevel;
+
+ if (!pk)
+ return '?'; /* Just in case a NULL PK is passed. */
+
+ trustlevel = get_validity (pk, uid);
+ if ( (trustlevel & TRUST_FLAG_REVOKED) )
+ return 'r';
+ return trust_letter (trustlevel);
}
const char *
@@ -1189,6 +1192,9 @@
{
int trustlevel;
+ if (!pk)
+ return "err"; /* Just in case a NULL PK is passed. */
+
trustlevel = get_validity (pk, uid);
if( trustlevel & TRUST_FLAG_REVOKED )
return _("revoked");
More information about the Gnupg-commits
mailing list