From: Seungbae Shin Date: Thu, 27 Aug 2020 10:28:52 +0000 (+0900) Subject: Fix Coverity defects X-Git-Tag: submit/tizen/20200827.104847^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=480ec0b9bfc56f35a4462d58a674a22063e17537;p=platform%2Fcore%2Fmultimedia%2Fpulseaudio-modules-tizen.git Fix Coverity defects - Unchecked return value (CHECKED_RETURN) - String not null terminated (STRING_NULL) [Version] 13.0.31 [Issue Type] Vulnerability Change-Id: I0e4b8c824c0d6dd9efe71d34d3576aa81453aa83 --- diff --git a/packaging/pulseaudio-modules-tizen.spec b/packaging/pulseaudio-modules-tizen.spec index bc64475..2264698 100644 --- a/packaging/pulseaudio-modules-tizen.spec +++ b/packaging/pulseaudio-modules-tizen.spec @@ -1,6 +1,6 @@ Name: pulseaudio-modules-tizen Summary: Pulseaudio modules for Tizen -Version: 13.0.30 +Version: 13.0.31 Release: 0 Group: Multimedia/Audio License: LGPL-2.1+ diff --git a/src/acm.c b/src/acm.c index a0d07a7..7f697c2 100644 --- a/src/acm.c +++ b/src/acm.c @@ -558,13 +558,13 @@ static void msg_thread_func(void *userdata) { } if ((recv_len = recv(u->msg_fd, recv_msg , IPC_MAX_MSG_LEN, 0)) > 0) { - if (!strcmp(recv_msg, MSG_DRAIN_COMPLETE)) { + if (!strncmp(recv_msg, MSG_DRAIN_COMPLETE, IPC_MAX_MSG_LEN)) { pa_log_debug("got drain complete signal [%s]", recv_msg); pa_cond_signal(u->msg_cond, false); - } else if (!strcmp(recv_msg, MSG_SEND_PAUSE)) { + } else if (!strncmp(recv_msg, MSG_SEND_PAUSE, IPC_MAX_MSG_LEN)) { pa_log_debug("got pause signal [%s]", recv_msg); u->need_pause = true; - } else if (!strcmp(recv_msg, MSG_SEND_RESUME) && u->need_pause) { + } else if (!strncmp(recv_msg, MSG_SEND_RESUME, IPC_MAX_MSG_LEN) && u->need_pause) { pa_log_debug("got resume signal [%s]", recv_msg); u->need_pause = false; pa_cond_signal(u->msg_cond, false); diff --git a/src/module-sound-player.c b/src/module-sound-player.c index 0322544..5e60af2 100644 --- a/src/module-sound-player.c +++ b/src/module-sound-player.c @@ -733,11 +733,11 @@ static void io_event_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io pa_log_info("name(%s), role(%s), volume_gain_type(%s), method(%s)", data.filename, data.role, data.volume_gain_type, data.method); - if (pa_streq(data.method, SOUND_PLAYER_METHOD_NAME_SIMPLE_PLAY)) + if (pa_strneq(data.method, SOUND_PLAYER_METHOD_NAME_SIMPLE_PLAY, METHOD_LEN)) _simple_play(u, data.filename, data.role, data.volume_gain_type); - else if (pa_streq(data.method, SOUND_PLAYER_METHOD_NAME_SIMPLE_STOP)) + else if (pa_strneq(data.method, SOUND_PLAYER_METHOD_NAME_SIMPLE_STOP, METHOD_LEN)) _simple_stop(u, data.filename); - else if (pa_streq(data.method, SOUND_PLAYER_METHOD_NAME_SIMPLE_STOP_ALL)) + else if (pa_strneq(data.method, SOUND_PLAYER_METHOD_NAME_SIMPLE_STOP_ALL, METHOD_LEN)) _simple_stop_all(u); else pa_log_error("Invalid method!!!"); diff --git a/src/subscribe-observer.c b/src/subscribe-observer.c index c565a36..a8ec66a 100644 --- a/src/subscribe-observer.c +++ b/src/subscribe-observer.c @@ -188,9 +188,9 @@ static int get_sender_pid(DBusConnection *c, DBusMessage *got_msg, uint32_t *_se return -1; } - dbus_message_append_args(msg, + pa_assert_se(dbus_message_append_args(msg, DBUS_TYPE_STRING, &sender, - DBUS_TYPE_INVALID); + DBUS_TYPE_INVALID)); dbus_error_init(&err); if (!(reply = dbus_connection_send_with_reply_and_block(c, msg, -1, &err))) {