sssd/0035-RESP-Add-some-missing-NULL-checks.patch

80 lines
2.8 KiB
Diff
Raw Normal View History

From 6e4b53c819d2cbc0a4e25b9813e24c47ad12febb Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Thu, 9 Nov 2017 13:24:47 +0100
Subject: [PATCH 35/79] RESP: Add some missing NULL checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
---
src/responder/autofs/autofssrv_dp.c | 4 ++++
src/responder/common/responder_dp.c | 4 ++++
src/responder/common/responder_dp_ssh.c | 4 ++++
src/responder/sudo/sudosrv_dp.c | 4 ++++
4 files changed, 16 insertions(+)
diff --git a/src/responder/autofs/autofssrv_dp.c b/src/responder/autofs/autofssrv_dp.c
index a323d83d9deb4e51180da9ff291044f1b9f64f76..bb8c2a42899b163b7727af778e554a5f55ca2d56 100644
--- a/src/responder/autofs/autofssrv_dp.c
+++ b/src/responder/autofs/autofssrv_dp.c
@@ -65,6 +65,10 @@ sss_dp_get_autofs_send(TALLOC_CTX *mem_ctx,
}
info = talloc_zero(state, struct sss_dp_get_autofs_info);
+ if (info == NULL) {
+ ret = ENOMEM;
+ goto error;
+ }
info->fast_reply = fast_reply;
info->type = type;
info->name = name;
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c
index a75a611960801f5f5bdc95f00aea9ab921e8e293..935a36d28d15d1074a0971fe9781474072578b8f 100644
--- a/src/responder/common/responder_dp.c
+++ b/src/responder/common/responder_dp.c
@@ -536,6 +536,10 @@ sss_dp_get_account_send(TALLOC_CTX *mem_ctx,
}
info = talloc_zero(state, struct sss_dp_account_info);
+ if (info == NULL) {
+ ret = ENOMEM;
+ goto error;
+ }
info->fast_reply = fast_reply;
info->type = type;
info->opt_name = opt_name;
diff --git a/src/responder/common/responder_dp_ssh.c b/src/responder/common/responder_dp_ssh.c
index 303ba1568b6230b0d4dfa718e4a7c024ae84d4e9..f78052296f07d3e21d8d4841a58c85fcf178fa1a 100644
--- a/src/responder/common/responder_dp_ssh.c
+++ b/src/responder/common/responder_dp_ssh.c
@@ -64,6 +64,10 @@ sss_dp_get_ssh_host_send(TALLOC_CTX *mem_ctx,
}
info = talloc_zero(state, struct sss_dp_get_ssh_host_info);
+ if (info == NULL) {
+ ret = ENOMEM;
+ goto error;
+ }
info->fast_reply = fast_reply;
info->name = name;
info->alias = alias;
diff --git a/src/responder/sudo/sudosrv_dp.c b/src/responder/sudo/sudosrv_dp.c
index 3a4a79473ff9915b3845643505d63411585aa262..f8ec8abc26d9710a2bccaadc4f807f963fe35f89 100644
--- a/src/responder/sudo/sudosrv_dp.c
+++ b/src/responder/sudo/sudosrv_dp.c
@@ -72,6 +72,10 @@ sss_dp_get_sudoers_send(TALLOC_CTX *mem_ctx,
}
info = talloc_zero(state, struct sss_dp_get_sudoers_info);
+ if (info == NULL) {
+ ret = ENOMEM;
+ goto error;
+ }
info->fast_reply = fast_reply;
info->type = type;
info->name = name;
--
2.15.1