summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorTomas Krizek <tkrizek@redhat.com>2017-01-12 10:49:12 +0100
committerMartin Basti <mbasti@redhat.com>2017-01-16 14:44:54 +0100
commit49855ca9dea9241ccd88e3a89b499b6fed4493c9 (patch)
treef0e7f4ef12f9e2a4812c9d60fff20170e2c982fe /ipaserver/plugins
parent504f4417070a308ef54b8f98ff25d02c6604a6f6 (diff)
downloadfreeipa-49855ca9dea9241ccd88e3a89b499b6fed4493c9.tar.gz
freeipa-49855ca9dea9241ccd88e3a89b499b6fed4493c9.tar.xz
freeipa-49855ca9dea9241ccd88e3a89b499b6fed4493c9.zip
Fix coverity issue
A code path exists, where principal_obj is None. Add check principal_obj is not None to avoid dereferencing it. Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/cert.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipaserver/plugins/cert.py b/ipaserver/plugins/cert.py
index cc47084b5..d8bfc1cd7 100644
--- a/ipaserver/plugins/cert.py
+++ b/ipaserver/plugins/cert.py
@@ -780,7 +780,8 @@ class cert_request(Create, BaseCertMethod, VirtualCommand):
"match requested principal") % gn.name)
elif isinstance(gn, cryptography.x509.general_name.RFC822Name):
if principal_type == USER:
- if gn.value not in principal_obj.get('mail', []):
+ if principal_obj and gn.value not in principal_obj.get(
+ 'mail', []):
raise errors.ValidationError(
name='csr',
error=_(