seahorse r2865 - in trunk: . pgp
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: seahorse r2865 - in trunk: . pgp
- Date: Sun, 1 Mar 2009 01:34:34 +0000 (UTC)
Author: nnielsen
Date: Sun Mar 1 01:34:34 2009
New Revision: 2865
URL: http://svn.gnome.org/viewvc/seahorse?rev=2865&view=rev
Log:
Don't crash when loading a key that initialy only has a secret part.
Modified:
trunk/ChangeLog
trunk/pgp/seahorse-gpgme-key.c
Modified: trunk/pgp/seahorse-gpgme-key.c
==============================================================================
--- trunk/pgp/seahorse-gpgme-key.c (original)
+++ trunk/pgp/seahorse-gpgme-key.c Sun Mar 1 01:34:34 2009
@@ -580,8 +580,17 @@
seahorse_gpgme_key_new (SeahorseSource *sksrc, gpgme_key_t pubkey,
gpgme_key_t seckey)
{
+ const gchar *keyid;
+
+ g_return_val_if_fail (pubkey || seckey, NULL);
+
+ if (pubkey != NULL)
+ keyid = pubkey->subkeys->keyid;
+ else
+ keyid = seckey->subkeys->keyid;
+
return g_object_new (SEAHORSE_TYPE_GPGME_KEY, "source", sksrc,
- "id", seahorse_pgp_key_canonize_id (pubkey->subkeys->keyid),
+ "id", seahorse_pgp_key_canonize_id (keyid),
"pubkey", pubkey, "seckey", seckey,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]