dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0003-krb5-locator-make-plugin-more-robust.patch

cdf651
From 4e851d1391f56c632c271fd21dd96f29565cadfe Mon Sep 17 00:00:00 2001
cdf651
From: Sumit Bose <sbose@redhat.com>
cdf651
Date: Tue, 22 May 2018 18:03:05 +0200
cdf651
Subject: [PATCH] krb5 locator: make plugin more robust
cdf651
cdf651
Although currently libkrb5 sets all parameters of the locator plugin
cdf651
calls to suitable values we should make sure that provided pointers are
cdf651
not NULL before trying to dereference them.
cdf651
cdf651
Related to https://pagure.io/SSSD/sssd/issue/941
cdf651
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
cdf651
cdf651
(cherry picked from commit c1fbc6b64ecaf51efc4379c4c8a4960de095abf0)
cdf651
---
cdf651
 src/krb5_plugin/sssd_krb5_locator_plugin.c | 4 ++++
cdf651
 1 file changed, 4 insertions(+)
cdf651
cdf651
diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c
cdf651
index 58cac7f4b244903347e6f1811cd8de2d61281c4f..9874fd2d1ce63b69099f057dd05f6e353a12ce75 100644
cdf651
--- a/src/krb5_plugin/sssd_krb5_locator_plugin.c
cdf651
+++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c
cdf651
@@ -439,6 +439,10 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data,
cdf651
     if (private_data == NULL) return KRB5_PLUGIN_NO_HANDLE;
cdf651
     ctx = (struct sssd_ctx *) private_data;
cdf651
 
cdf651
+    if (realm == NULL || cbfunc == NULL || cbdata == NULL) {
cdf651
+        return KRB5_PLUGIN_NO_HANDLE;
cdf651
+    }
cdf651
+
cdf651
     if (ctx->disabled) {
cdf651
         PLUGIN_DEBUG(("Plugin disabled, nothing to do.\n"));
cdf651
         return KRB5_PLUGIN_NO_HANDLE;
cdf651
-- 
cdf651
2.17.1
cdf651