From f73f40c97aeabe1e164f9cf4995acec99a12ccdd Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Wed, 17 Jan 2018 13:46:43 +0000 Subject: [PATCH] negative check --- ncrypt/crypt_gpgme.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 012a70caf..3cad2bd3a 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -1801,6 +1801,8 @@ static struct Body *decrypt_part(struct Body *a, struct State *s, FILE *fpout, ctx = create_gpgme_context(is_smime); restart: + if (a->length < 0) + return NULL; /* Make a data object from the body, create context etc. */ ciphertext = file_to_data_object(s->fpin, a->offset, a->length); if (!ciphertext) -- 2.49.0