Blame SOURCES/0016-clang-Dereference-of-null-pointer.patch

d4b2f2
From 319858127df42c1a95b9b3282705c90ecd6754a5 Mon Sep 17 00:00:00 2001
d4b2f2
From: Rob Crittenden <rcritten@redhat.com>
d4b2f2
Date: Fri, 14 Sep 2018 16:16:55 -0400
d4b2f2
Subject: [PATCH 16/17] clang: Dereference of null pointer
d4b2f2
d4b2f2
---
d4b2f2
 src/tdbush.c | 56 +++++++++++++++++++++++++++++---------------------------
d4b2f2
 1 file changed, 29 insertions(+), 27 deletions(-)
d4b2f2
d4b2f2
diff --git a/src/tdbush.c b/src/tdbush.c
d4b2f2
index 3184e67a..d1bbe4da 100644
d4b2f2
--- a/src/tdbush.c
d4b2f2
+++ b/src/tdbush.c
d4b2f2
@@ -3655,37 +3655,39 @@ request_modify(DBusConnection *conn, DBusMessage *msg,
d4b2f2
 				break;
d4b2f2
 			}
d4b2f2
 		}
d4b2f2
-		if (d[i] == NULL) {
d4b2f2
-			new_request_path = talloc_asprintf(parent, "%s/%s",
d4b2f2
-							   CM_DBUS_REQUEST_PATH,
d4b2f2
-							   entry->cm_busname);
d4b2f2
-			if ((n_propname > 0) &&
d4b2f2
-			    (n_propname + 1 < sizeof(propname) / sizeof(propname[0]))) {
d4b2f2
-				propname[n_propname] = NULL;
d4b2f2
-				cm_tdbush_property_emit_changed(ctx, new_request_path,
d4b2f2
-								CM_DBUS_REQUEST_INTERFACE,
d4b2f2
-								propname);
d4b2f2
-			}
d4b2f2
-			cm_tdbusm_set_bp(rep,
d4b2f2
-					 cm_restart_entry(ctx,
d4b2f2
-							  entry->cm_nickname),
d4b2f2
-					 new_request_path);
d4b2f2
-			dbus_connection_send(conn, rep, NULL);
d4b2f2
-			dbus_message_unref(rep);
d4b2f2
-			talloc_free(new_request_path);
d4b2f2
-			return DBUS_HANDLER_RESULT_HANDLED;
d4b2f2
-		} else {
d4b2f2
-			dbus_message_unref(rep);
d4b2f2
-			rep = dbus_message_new_error(msg,
d4b2f2
-						     CM_DBUS_ERROR_REQUEST_BAD_ARG,
d4b2f2
-						     _("Unrecognized parameter or wrong value type."));
d4b2f2
-			if (rep != NULL) {
d4b2f2
-				cm_tdbusm_set_s(rep, d[i]->key);
d4b2f2
+		if (d != NULL) {
d4b2f2
+			if (d[i] == NULL) {
d4b2f2
+				new_request_path = talloc_asprintf(parent, "%s/%s",
d4b2f2
+								   CM_DBUS_REQUEST_PATH,
d4b2f2
+								   entry->cm_busname);
d4b2f2
+				if ((n_propname > 0) &&
d4b2f2
+				    (n_propname + 1 < sizeof(propname) / sizeof(propname[0]))) {
d4b2f2
+					propname[n_propname] = NULL;
d4b2f2
+					cm_tdbush_property_emit_changed(ctx, new_request_path,
d4b2f2
+									CM_DBUS_REQUEST_INTERFACE,
d4b2f2
+									propname);
d4b2f2
+				}
d4b2f2
+				cm_tdbusm_set_bp(rep,
d4b2f2
+						 cm_restart_entry(ctx,
d4b2f2
+								  entry->cm_nickname),
d4b2f2
+						 new_request_path);
d4b2f2
 				dbus_connection_send(conn, rep, NULL);
d4b2f2
 				dbus_message_unref(rep);
d4b2f2
+				talloc_free(new_request_path);
d4b2f2
 				return DBUS_HANDLER_RESULT_HANDLED;
d4b2f2
+			} else {
d4b2f2
+				dbus_message_unref(rep);
d4b2f2
+				rep = dbus_message_new_error(msg,
d4b2f2
+							     CM_DBUS_ERROR_REQUEST_BAD_ARG,
d4b2f2
+							     _("Unrecognized parameter or wrong value type."));
d4b2f2
+				if (rep != NULL) {
d4b2f2
+					cm_tdbusm_set_s(rep, d[i]->key);
d4b2f2
+					dbus_connection_send(conn, rep, NULL);
d4b2f2
+					dbus_message_unref(rep);
d4b2f2
+					return DBUS_HANDLER_RESULT_HANDLED;
d4b2f2
+				}
d4b2f2
+				return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
d4b2f2
 			}
d4b2f2
-			return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
d4b2f2
 		}
d4b2f2
 	} else {
d4b2f2
 		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
d4b2f2
-- 
d4b2f2
2.14.4
d4b2f2