dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0059-ifp-fix-typo-causing-a-crash-in-FindByNameAndCertifi.patch

71e593
From b4063b2d3f1c700aa074f71d5db501e1bdfd6d2a Mon Sep 17 00:00:00 2001
71e593
From: Sumit Bose <sbose@redhat.com>
71e593
Date: Wed, 24 Oct 2018 17:27:21 +0200
71e593
Subject: [PATCH] ifp: fix typo causing a crash in FindByNameAndCertificate
71e593
71e593
Due to a typo in the recent refactoring the InfoPipe crashes in the
71e593
FindByNameAndCertificate request.
71e593
71e593
Additionally a state variable in set to the expected value.
71e593
71e593
Related to https://pagure.io/SSSD/sssd/issue/3863
71e593
71e593
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
71e593
---
71e593
 src/responder/ifp/ifp_users.c | 8 +++++++-
71e593
 1 file changed, 7 insertions(+), 1 deletion(-)
71e593
71e593
diff --git a/src/responder/ifp/ifp_users.c b/src/responder/ifp/ifp_users.c
71e593
index dd44afcc45df5c29e3a9926bf42cd416e3445d77..5dd34d68808fa0230d77de1fd3805b5971cb9aa6 100644
71e593
--- a/src/responder/ifp/ifp_users.c
71e593
+++ b/src/responder/ifp/ifp_users.c
71e593
@@ -584,6 +584,12 @@ ifp_users_find_by_name_and_cert_send(TALLOC_CTX *mem_ctx,
71e593
     }
71e593
 
71e593
     if (!SBUS_REQ_STRING_IS_EMPTY(pem_cert)) {
71e593
+        state->pem_cert = talloc_strdup(state, pem_cert);
71e593
+        if (state->pem_cert == NULL) {
71e593
+            ret = ENOMEM;
71e593
+            goto done;
71e593
+        }
71e593
+
71e593
         ret = sss_cert_pem_to_derb64(state, pem_cert, &state->derb64);
71e593
         if (ret != EOK) {
71e593
             DEBUG(SSSDBG_OP_FAILURE, "sss_cert_pem_to_derb64 failed.\n");
71e593
@@ -741,7 +747,7 @@ static void ifp_users_find_by_name_and_cert_done(struct tevent_req *subreq)
71e593
         return;
71e593
     }
71e593
 
71e593
-    ret = ifp_users_list_by_cert_step(req);
71e593
+    ret = ifp_users_find_by_name_and_cert_step(req);
71e593
     if (ret == EOK) {
71e593
         tevent_req_done(req);
71e593
     } else if (ret != EAGAIN) {
71e593
-- 
71e593
2.14.4
71e593