dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From 87f7c2f1f44085963b41eb78e337840ddbc7be76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Thu, 14 Jul 2016 10:49:37 +0200
Subject: [PATCH 097/102] sifp: fix coverity warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

sssd-1.14.1/src/lib/sifp/sss_sifp_dbus.c:51: check_return:
  Calling "dbus_message_append_args_valist" without checking return value
  (as is done elsewhere 4 out of 5 times).

Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit de5160e354c02020f0593c7cabdb811107d5d8e2)
---
 src/lib/sifp/sss_sifp_dbus.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lib/sifp/sss_sifp_dbus.c b/src/lib/sifp/sss_sifp_dbus.c
index 7c72c52f0d226ccdfaf7b8ffaed7776647a7771c..2906c5ac383c412231127f6ffa8081d47eb2bced 100644
--- a/src/lib/sifp/sss_sifp_dbus.c
+++ b/src/lib/sifp/sss_sifp_dbus.c
@@ -36,6 +36,7 @@ static sss_sifp_error sss_sifp_ifp_call(sss_sifp_ctx *ctx,
 {
    DBusMessage *msg = NULL;
    sss_sifp_error ret;
+   dbus_bool_t bret;
 
    if (object_path == NULL || interface == NULL || method == NULL) {
        return SSS_SIFP_INVALID_ARGUMENT;
@@ -48,7 +49,11 @@ static sss_sifp_error sss_sifp_ifp_call(sss_sifp_ctx *ctx,
    }
 
    if (first_arg_type != DBUS_TYPE_INVALID) {
-       dbus_message_append_args_valist(msg, first_arg_type, ap);
+       bret = dbus_message_append_args_valist(msg, first_arg_type, ap);
+       if (!bret) {
+           ret = SSS_SIFP_IO_ERROR;
+           goto done;
+       }
    }
 
    ret = sss_sifp_send_message(ctx, msg, _reply);
-- 
2.4.11