]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fixed a segfault in the OpenPGP code.
authorTimo Schulz <twoaday@gnutls.org>
Thu, 21 Feb 2002 13:49:30 +0000 (13:49 +0000)
committerTimo Schulz <twoaday@gnutls.org>
Thu, 21 Feb 2002 13:49:30 +0000 (13:49 +0000)
lib/gnutls_openpgp.c

index b5b0b7bbe9627fc266d38da5573a9b110bde6fd1..add1ca6b95cd7a68b45a74838b0bdf81b3ba49d4 100644 (file)
@@ -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)