e3ffab
From 73aa4b8a8b7352679a9c1e5ef900824be7b8f37c Mon Sep 17 00:00:00 2001
e3ffab
From: Jan Cholasta <jcholast@redhat.com>
e3ffab
Date: Wed, 5 Nov 2014 08:44:05 +0000
e3ffab
Subject: [PATCH] Fix possible NULL dereference in ipa-kdb
e3ffab
e3ffab
https://fedorahosted.org/freeipa/ticket/4651
e3ffab
e3ffab
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
e3ffab
---
e3ffab
 daemons/ipa-kdb/ipa_kdb_mspac.c | 8 +++++---
e3ffab
 1 file changed, 5 insertions(+), 3 deletions(-)
e3ffab
e3ffab
diff --git a/daemons/ipa-kdb/ipa_kdb_mspac.c b/daemons/ipa-kdb/ipa_kdb_mspac.c
e3ffab
index 084b689d459f27e72d679d37e24650149973df61..c8f6c76fb5b3bc7d47ec8a1551579d53d226027e 100644
e3ffab
--- a/daemons/ipa-kdb/ipa_kdb_mspac.c
e3ffab
+++ b/daemons/ipa-kdb/ipa_kdb_mspac.c
e3ffab
@@ -1888,9 +1888,11 @@ void get_authz_data_types(krb5_context context, krb5_db_entry *entry,
e3ffab
         }
e3ffab
 
e3ffab
         ipactx = ipadb_get_context(context);
e3ffab
-        gcfg = ipadb_get_global_config(ipactx);
e3ffab
-        if (gcfg != NULL)
e3ffab
-            tmp = gcfg->authz_data;
e3ffab
+        if (ipactx != NULL) {
e3ffab
+            gcfg = ipadb_get_global_config(ipactx);
e3ffab
+            if (gcfg != NULL)
e3ffab
+                tmp = gcfg->authz_data;
e3ffab
+        }
e3ffab
         if (ipactx == NULL || tmp == NULL) {
e3ffab
             krb5_klog_syslog(LOG_ERR, "No default authorization data types " \
e3ffab
                                       "available, no authorization data will " \
e3ffab
-- 
e3ffab
2.1.0
e3ffab