summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2021-02-25 09:18:46 -0500
committerChristopher Michael <devilhorns@comcast.net>2021-02-25 09:18:46 -0500
commit3a07f18294e73f0b306077861d7b54a06130fc06 (patch)
tree6dbfc718b405e680ca44c7788cab3086a6fdcc53 /src
parent598b7a1be6f6e42b217c423c6dcdad8132a1a941 (diff)
eldbus_fake_server: Fix unchecked return value
Small patch to check return values of eldbus_message_iter_arguments_get reported by Coverity. Fixes CID1401042
Diffstat (limited to 'src')
-rw-r--r--src/tests/eldbus/eldbus_fake_server.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/tests/eldbus/eldbus_fake_server.c b/src/tests/eldbus/eldbus_fake_server.c
index 41d4b1f7a4..32f5b9bd17 100644
--- a/src/tests/eldbus/eldbus_fake_server.c
+++ b/src/tests/eldbus/eldbus_fake_server.c
@@ -153,12 +153,20 @@ _fake_server_property_set(const Eldbus_Service_Interface *iface,
153 ck_assert_ptr_ne(NULL, data); 153 ck_assert_ptr_ne(NULL, data);
154 154
155 if (strcmp(propname, FAKE_SERVER_WRITEONLY_PROPERTY) == 0) 155 if (strcmp(propname, FAKE_SERVER_WRITEONLY_PROPERTY) == 0)
156 eldbus_message_iter_arguments_get(iter, "i", &data->writeonly_property); 156 {
157 else 157 if (!eldbus_message_iter_arguments_get(iter, "i", &data->writeonly_property))
158 if (strcmp(propname, FAKE_SERVER_READWRITE_PROPERTY) == 0) 158 ck_abort_msg("error getting iter arguments on _fake_server_property_set");
159 eldbus_message_iter_arguments_get(iter, "i", &data->readwrite_property); 159 }
160 else 160 else
161 return eldbus_message_error_new(msg, "Invalid property", "Invalid property."); 161 {
162 if (strcmp(propname, FAKE_SERVER_READWRITE_PROPERTY) == 0)
163 {
164 if (!eldbus_message_iter_arguments_get(iter, "i", &data->readwrite_property))
165 ck_abort_msg("error getting iter arguments on _fake_server_property_set");
166 }
167 else
168 return eldbus_message_error_new(msg, "Invalid property", "Invalid property.");
169 }
162 170
163 return eldbus_message_method_return_new(msg); 171 return eldbus_message_method_return_new(msg);
164} 172}