dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

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

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