aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-09-28 17:11:32 +0000
committerWerner Koch <[email protected]>2009-09-28 17:11:32 +0000
commit378b313f58f74fc3ee99d9b1ce69fe5d1343b1fb (patch)
treed01b9edd4d60b452da6ab64f0c73e02f480ede6c
parentMake it easier to distribute bzip2 (diff)
downloadgnupg-378b313f58f74fc3ee99d9b1ce69fe5d1343b1fb.tar.gz
gnupg-378b313f58f74fc3ee99d9b1ce69fe5d1343b1fb.zip
Fix bug#1138.
-rw-r--r--g10/ChangeLog8
-rw-r--r--g10/photoid.c6
-rw-r--r--g10/trustdb.c6
3 files changed, 17 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index e239d9e14..88227e37a 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-28 Werner Koch <[email protected]>
+
+ * trustdb.c (get_validity_info): Take care of a NULL PK. Fixes
+ bug#1138.
+ (get_validity_string): Ditto.
+
2009-09-02 Werner Koch <[email protected]>
* 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.
diff --git a/g10/photoid.c b/g10/photoid.c
index 38003d840..727a9ff90 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -194,7 +194,8 @@ generate_photo_id(PKT_public_key *pk,const char *photo_name)
}
/* 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 @@ int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len)
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;
diff --git a/g10/trustdb.c b/g10/trustdb.c
index d435ce676..6fa082b3a 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1182,6 +1182,9 @@ get_validity_info (PKT_public_key *pk, PKT_user_id *uid)
{
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 @@ get_validity_string (PKT_public_key *pk, PKT_user_id *uid)
{
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");