|
|
c0971b7 |
From 30f4adf874aff174734ad77902a79fc5727ab495 Mon Sep 17 00:00:00 2001
|
|
|
c0971b7 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
c0971b7 |
Date: Thu, 16 Aug 2018 12:57:47 +0200
|
|
|
c0971b7 |
Subject: [PATCH 10/83] sbus: check for null message in sbus_message_bound
|
|
|
c0971b7 |
|
|
|
c0971b7 |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
c0971b7 |
---
|
|
|
c0971b7 |
src/sbus/request/sbus_message.c | 10 ++++++++++
|
|
|
c0971b7 |
1 file changed, 10 insertions(+)
|
|
|
c0971b7 |
|
|
|
c0971b7 |
diff --git a/src/sbus/request/sbus_message.c b/src/sbus/request/sbus_message.c
|
|
|
c0971b7 |
index 950be91..7314fd7 100644
|
|
|
c0971b7 |
--- a/src/sbus/request/sbus_message.c
|
|
|
c0971b7 |
+++ b/src/sbus/request/sbus_message.c
|
|
|
c0971b7 |
@@ -83,6 +83,11 @@ sbus_message_bound(TALLOC_CTX *mem_ctx, DBusMessage *msg)
|
|
|
c0971b7 |
return EINVAL;
|
|
|
c0971b7 |
}
|
|
|
c0971b7 |
|
|
|
c0971b7 |
+ if (msg == NULL) {
|
|
|
c0971b7 |
+ DEBUG(SSSDBG_CRIT_FAILURE, "Message can not be NULL!\n");
|
|
|
c0971b7 |
+ return EINVAL;
|
|
|
c0971b7 |
+ }
|
|
|
c0971b7 |
+
|
|
|
c0971b7 |
/* Create a talloc context that will unreference this message when
|
|
|
c0971b7 |
* the parent context is freed. */
|
|
|
c0971b7 |
talloc_msg = talloc(mem_ctx, struct sbus_talloc_msg);
|
|
|
c0971b7 |
@@ -122,6 +127,11 @@ sbus_message_bound(TALLOC_CTX *mem_ctx, DBusMessage *msg)
|
|
|
c0971b7 |
errno_t
|
|
|
c0971b7 |
sbus_message_bound_ref(TALLOC_CTX *mem_ctx, DBusMessage *msg)
|
|
|
c0971b7 |
{
|
|
|
c0971b7 |
+ if (msg == NULL) {
|
|
|
c0971b7 |
+ DEBUG(SSSDBG_CRIT_FAILURE, "Message can not be NULL!\n");
|
|
|
c0971b7 |
+ return EINVAL;
|
|
|
c0971b7 |
+ }
|
|
|
c0971b7 |
+
|
|
|
c0971b7 |
dbus_message_ref(msg);
|
|
|
c0971b7 |
return sbus_message_bound(mem_ctx, msg);
|
|
|
c0971b7 |
}
|
|
|
c0971b7 |
--
|
|
|
c0971b7 |
2.9.5
|
|
|
c0971b7 |
|