X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=crypto.c;h=6f4a6db9d0f1be2026f73068b6696e5557640d80;hp=9736517f7f6d3ef633438f0c312e3b7d3873c668;hb=4e2c351c588ad74f4800ca0344232be90387c54a;hpb=8c6fd797952d38e03d46fd6b57bd6a1a63474de8 diff --git a/crypto.c b/crypto.c index 9736517f..6f4a6db9 100644 --- a/crypto.c +++ b/crypto.c @@ -69,6 +69,11 @@ notmuch_crypto_get_context (notmuch_crypto_t *crypto, const char *protocol) { notmuch_crypto_context_t *cryptoctx = NULL; + if (! protocol) { + fprintf (stderr, "Cryptographic protocol is empty.\n"); + return cryptoctx; + } + /* As per RFC 1847 section 2.1: "the [protocol] value token is * comprised of the type and sub-type tokens of the Content-Type". * As per RFC 1521 section 2: "Content-Type values, subtypes, and