URL: https://github.com/SSSD/sssd/pull/5858
Author: johanburati
 Title: #5858: Add check for null pointer in dp_client_register
Action: opened

PR body:
"""
Tentative fix for https://github.com/SSSD/sssd/issues/5857
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5858/head:pr5858
git checkout pr5858
From 696be032ab28263437e7638c7afa9504c099ebda Mon Sep 17 00:00:00 2001
From: Johan Burati <johan.bur...@gmail.com>
Date: Mon, 1 Nov 2021 09:47:56 +0900
Subject: [PATCH] Add check for null pointer in dp_client_register

---
 src/providers/data_provider/dp_client.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/providers/data_provider/dp_client.c b/src/providers/data_provider/dp_client.c
index dcf939e578..3b9476145c 100644
--- a/src/providers/data_provider/dp_client.c
+++ b/src/providers/data_provider/dp_client.c
@@ -104,6 +104,11 @@ dp_client_register(TALLOC_CTX *mem_ctx,
 
     dp_cli = sbus_connection_get_data(cli_conn, struct dp_client);
 
+    if (dp_cli == NULL) {
+        DEBUG(SSSDBG_CRIT_FAILURE, "Unknown client! [%s]\n", name);
+        return ENOENT;
+    }
+
     dp_cli->name = talloc_strdup(dp_cli, name);
     if (dp_cli->name == NULL) {
         talloc_free(dp_cli);
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to