summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_openpgp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gnutls_openpgp.c b/lib/gnutls_openpgp.c
index b5b0b7bbe9..add1ca6b95 100644
--- a/lib/gnutls_openpgp.c
+++ b/lib/gnutls_openpgp.c
@@ -141,9 +141,12 @@ read_keyring_blob(const gnutls_datum* keyring, size_t pos)
{
keyring_blob *blob = NULL;
- if (!keyring || pos > keyring->size)
+ if (!keyring || !keyring->data)
return NULL;
+ if (pos > keyring->size)
+ return NULL;
+
keyring_blob_new(&blob);
blob->type = keyring->data[pos];
if (blob->type < 0 || blob->type > 1)