From 94901b6cfe7a956de3326c6bf43d91d687e99ee8 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 6 Mar 2008 14:54:11 +0000 Subject: [PATCH] 2008-03-06 Marcus Brinkmann * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL. Reported by Marc Mutz. --- trunk/gpgme/ChangeLog | 5 +++++ trunk/gpgme/key.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 8285ff8..a27204c 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2008-03-06 Marcus Brinkmann + + * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL. + Reported by Marc Mutz. + 2008-03-05 Marcus Brinkmann * decrypt.c (release_op_data): Release OPD->result.recipients. diff --git a/trunk/gpgme/key.c b/trunk/gpgme/key.c index 3dde670..c9f48f8 100644 --- a/trunk/gpgme/key.c +++ b/trunk/gpgme/key.c @@ -252,7 +252,7 @@ _gpgme_key_add_sig (gpgme_key_t key, char *src) assert (uid); /* XXX */ /* We can malloc a buffer of the same length, because the converted - string will never be larger. Actually we allocate it twice the + string will never be larger. Actually we allocate it twice the size, so that we are able to store the parsed stuff there too. */ sig = malloc (sizeof (*sig) + 2 * src_len + 3); if (!sig) @@ -275,6 +275,8 @@ _gpgme_key_add_sig (gpgme_key_t key, char *src) parse_user_id (sig->uid, &sig->name, &sig->email, &sig->comment, dst); } + else + sig->uid = '\0'; if (!uid->signatures) uid->signatures = sig; -- 2.26.2