diff options
author | Werner Koch <wk@gnupg.org> | 2011-02-23 10:51:36 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-02-23 10:51:36 +0100 |
commit | 6902560059df490f91c2f00f0400cfbd00a84be6 (patch) | |
tree | e7ea663d24c5030f578b86af27a90822c3ed166a /dirmngr/certcache.c | |
parent | Lock scdaemon to CCID if once found. (diff) | |
download | gnupg2-6902560059df490f91c2f00f0400cfbd00a84be6.tar.xz gnupg2-6902560059df490f91c2f00f0400cfbd00a84be6.zip |
Fix dirmngr crash (bug#1300)
Diffstat (limited to '')
-rw-r--r-- | dirmngr/certcache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dirmngr/certcache.c b/dirmngr/certcache.c index 1fb585ae2..3ada60dfe 100644 --- a/dirmngr/certcache.c +++ b/dirmngr/certcache.c @@ -652,6 +652,9 @@ get_cert_bysubject (const char *subject_dn, unsigned int seq) cert_item_t ci; int i; + if (!subject_dn) + return NULL; + acquire_cache_read_lock (); for (i=0; i < 256; i++) { @@ -1101,7 +1104,7 @@ find_cert_bysubject (ctrl_t ctrl, const char *subject_dn, ksba_sexp_t keyid) uniquely located by the following code we can use them. This is for example required by Telesec certificates where a keyId is used but the issuer certificate comes without a subject keyId! */ - if (ctrl->ocsp_certs) + if (ctrl->ocsp_certs && subject_dn) { cert_item_t ci; cert_ref_t cr; |