From: Timo Schulz Date: Thu, 21 Feb 2002 13:49:30 +0000 (+0000) Subject: Fixed a segfault in the OpenPGP code. X-Git-Tag: gnutls_0_3_90~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b0557dbf920e87da377907ebc850c8d14cd5730;p=thirdparty%2Fgnutls.git Fixed a segfault in the OpenPGP code. --- 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)