diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-04-15 13:58:05 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-04-15 13:58:05 +0200 |
commit | 86ff57e8f9f5f33d820b64b5cfdc60cb830b6d94 (patch) | |
tree | 855039c1ffdca5afd75af0021b592869517d7a34 /lib/openpgp/privkey.c | |
parent | 83b64980f5ec9c3110cf0cd44d8815271ece7996 (diff) | |
download | gnutls-86ff57e8f9f5f33d820b64b5cfdc60cb830b6d94.tar.gz |
several bug fixes due to coverity.
Diffstat (limited to 'lib/openpgp/privkey.c')
-rw-r--r-- | lib/openpgp/privkey.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c index 44a9b3226c..6aa6fb5436 100644 --- a/lib/openpgp/privkey.c +++ b/lib/openpgp/privkey.c @@ -1219,16 +1219,16 @@ int gnutls_openpgp_privkey_get_preferred_key_id(gnutls_openpgp_privkey_t key, gnutls_openpgp_keyid_t keyid) { - if (!key->preferred_set) - return - gnutls_assert_val - (GNUTLS_E_OPENPGP_PREFERRED_KEY_ERROR); - if (!key || !keyid) { gnutls_assert(); return GNUTLS_E_INVALID_REQUEST; } + if (!key->preferred_set) + return + gnutls_assert_val + (GNUTLS_E_OPENPGP_PREFERRED_KEY_ERROR); + memcpy(keyid, key->preferred_keyid, GNUTLS_OPENPGP_KEYID_SIZE); return 0; |