[svn] GnuPG - r5166 - branches/STABLE-BRANCH-1-4/g10

svn author wk cvs at cvs.gnupg.org
Mon Sep 28 19:11:33 CEST 2009


Author: wk
Date: 2009-09-28 19:11:32 +0200 (Mon, 28 Sep 2009)
New Revision: 5166

Modified:
   branches/STABLE-BRANCH-1-4/g10/ChangeLog
   branches/STABLE-BRANCH-1-4/g10/photoid.c
   branches/STABLE-BRANCH-1-4/g10/trustdb.c
Log:
Fix bug#1138.


Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog	2009-09-28 17:11:10 UTC (rev 5165)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog	2009-09-28 17:11:32 UTC (rev 5166)
@@ -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-02  Werner Koch  <wk at g10code.com>
 
 	* app-openpgp.c (do_decipher): Compute required Le.
@@ -108,7 +114,7 @@
 	TIMESTAMP.
 	(write_direct_sig, write_selfsigs, write_keybinding)
 	(make_backsig): Ditto.
-	(do_generate_keypair): Pass timestamp to all signing functions. 
+	(do_generate_keypair): Pass timestamp to all signing functions.
 	(generate_card_subkeypair): Ditto.
 	* keyedit.c (menu_backsign): Pass a new timestamp to all backsisg.
 

Modified: branches/STABLE-BRANCH-1-4/g10/photoid.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/photoid.c	2009-09-28 17:11:10 UTC (rev 5165)
+++ branches/STABLE-BRANCH-1-4/g10/photoid.c	2009-09-28 17:11:32 UTC (rev 5166)
@@ -194,7 +194,8 @@
 }
 
 /* Returns 0 for error, 1 for valid */
-int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len)
+int 
+parse_image_header(const struct user_attribute *attr,byte *type,u32 *len)
 {
   u16 headerlen;
 
@@ -229,7 +230,8 @@
    make sure it is not too big (see parse-packet.c:parse_attribute).
    Extensions should be 3 characters long for the best cross-platform
    compatibility. */
-char *image_type_to_string(byte type,int style)
+char *
+image_type_to_string(byte type,int style)
 {
   char *string;
 

Modified: branches/STABLE-BRANCH-1-4/g10/trustdb.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/trustdb.c	2009-09-28 17:11:10 UTC (rev 5165)
+++ branches/STABLE-BRANCH-1-4/g10/trustdb.c	2009-09-28 17:11:32 UTC (rev 5166)
@@ -1182,6 +1182,9 @@
 {
     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';
@@ -1193,6 +1196,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