diff options
Diffstat (limited to 'src/gmcerts.c')
-rw-r--r-- | src/gmcerts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gmcerts.c b/src/gmcerts.c index 36fd7d55..f95fea7d 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c | |||
@@ -295,6 +295,9 @@ static void loadIdentities_GmCerts_(iGmCerts *d) { | |||
295 | } | 295 | } |
296 | 296 | ||
297 | iGmIdentity *findIdentity_GmCerts(iGmCerts *d, const iBlock *fingerprint) { | 297 | iGmIdentity *findIdentity_GmCerts(iGmCerts *d, const iBlock *fingerprint) { |
298 | if (isEmpty_Block(fingerprint)) { | ||
299 | return NULL; | ||
300 | } | ||
298 | iForEach(PtrArray, i, &d->idents) { | 301 | iForEach(PtrArray, i, &d->idents) { |
299 | iGmIdentity *ident = i.ptr; | 302 | iGmIdentity *ident = i.ptr; |
300 | if (cmp_Block(fingerprint, &ident->fingerprint) == 0) { /* TODO: could use a hash */ | 303 | if (cmp_Block(fingerprint, &ident->fingerprint) == 0) { /* TODO: could use a hash */ |
@@ -549,6 +552,9 @@ const iGmIdentity *constIdentity_GmCerts(const iGmCerts *d, unsigned int id) { | |||
549 | } | 552 | } |
550 | 553 | ||
551 | const iGmIdentity *identityForUrl_GmCerts(const iGmCerts *d, const iString *url) { | 554 | const iGmIdentity *identityForUrl_GmCerts(const iGmCerts *d, const iString *url) { |
555 | if (isEmpty_String(url)) { | ||
556 | return NULL; | ||
557 | } | ||
552 | lock_Mutex(d->mtx); | 558 | lock_Mutex(d->mtx); |
553 | const iGmIdentity *found = NULL; | 559 | const iGmIdentity *found = NULL; |
554 | iConstForEach(PtrArray, i, &d->idents) { | 560 | iConstForEach(PtrArray, i, &d->idents) { |