From 77d4671c86e96734f61b19bd0a4f28d4b1bb17be Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Fri, 29 Jun 2018 14:50:26 +0900 Subject: [PATCH] Fix stack-buffer-overflow bug issued by ASAN [Version] 0.12.22 [Issue Type] Bug Change-Id: If94c462f9e586a56a3e26bfdfe4256c1894df6f1 --- mm_sound_proxy.c | 16 ++++++++-------- packaging/libmm-sound.spec | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mm_sound_proxy.c b/mm_sound_proxy.c index 2fdd73a..2a946c8 100644 --- a/mm_sound_proxy.c +++ b/mm_sound_proxy.c @@ -86,7 +86,7 @@ static int _notify_signal_handled(audio_event_t event, uint32_t event_id, uint32 } static int parse_device_variant(GVariant *v, int *device_id, const char **device_type, int *direction, int *state, - const char **device_name, int *vendor_id, int *product_id, bool *is_running, int *stream_id, int *stream_num) + const char **device_name, int *vendor_id, int *product_id, gboolean *is_running, int *stream_id, int *stream_num) { const char *v_type; GVariant *array_v; @@ -144,7 +144,7 @@ static void dbus_callback(audio_event_t event, GVariant *params, void *userdata) int stream_id[MAX_STREAM_ON_DEVICE]; int stream_num; int vendor_id, product_id; - bool is_running = FALSE; + gboolean is_running = FALSE; v_type = g_variant_get_type_string(params); @@ -155,7 +155,7 @@ static void dbus_callback(audio_event_t event, GVariant *params, void *userdata) g_variant_get(params, "(&s&su)", &direction, &volume_type_str, &volume_level); ((mm_sound_volume_changed_wrapper_cb)(cb_data->user_cb))(direction, volume_type_str, volume_level, cb_data->user_data); } else if (event == AUDIO_EVENT_DEVICE_CONNECTED) { - bool is_connected = false; + gboolean is_connected = FALSE; if (g_variant_type_equal(v_type, "(u(isiisiibai)b)") == FALSE) { debug_error("Device connection changed signature not matching : %s", v_type); @@ -172,8 +172,8 @@ static void dbus_callback(audio_event_t event, GVariant *params, void *userdata) g_variant_iter_next(&iter, "b", &is_connected); ((mm_sound_device_connected_wrapper_cb)(cb_data->user_cb))(device_id, device_type, direction, - state, name, vendor_id, product_id, is_running, stream_id, stream_num, is_connected, cb_data->user_data); - _notify_signal_handled(event, event_id, cb_data->subs_id, g_variant_new("(ib)", device_id, is_connected)); + state, name, vendor_id, product_id, (bool)is_running, stream_id, stream_num, (bool)is_connected, cb_data->user_data); + _notify_signal_handled(event, event_id, cb_data->subs_id, g_variant_new("(ib)", device_id, (bool)is_connected)); } else if (event == AUDIO_EVENT_DEVICE_INFO_CHANGED) { int changed_device_info_type = 0; @@ -193,7 +193,7 @@ static void dbus_callback(audio_event_t event, GVariant *params, void *userdata) g_variant_iter_next(&iter, "i", &changed_device_info_type); ((mm_sound_device_info_changed_wrapper_cb)(cb_data->user_cb))(device_id, device_type, direction, - state, name, vendor_id, product_id, is_running, stream_id, stream_num, changed_device_info_type, cb_data->user_data); + state, name, vendor_id, product_id, (bool)is_running, stream_id, stream_num, changed_device_info_type, cb_data->user_data); } else if (event == AUDIO_EVENT_DEVICE_STATE_CHANGED) { if (g_variant_type_equal(v_type, "(u(isiisiibai))") == FALSE) { @@ -211,7 +211,7 @@ static void dbus_callback(audio_event_t event, GVariant *params, void *userdata) } ((mm_sound_device_state_changed_wrapper_cb)(cb_data->user_cb))(device_id, device_type, direction, - state, name, vendor_id, product_id, is_running, stream_id, stream_num, cb_data->user_data); + state, name, vendor_id, product_id, (bool)is_running, stream_id, stream_num, cb_data->user_data); } else if (event == AUDIO_EVENT_DEVICE_RUNNING_CHANGED) { if (g_variant_type_equal(v_type, "(u(isiisiibai))") == FALSE) { @@ -229,7 +229,7 @@ static void dbus_callback(audio_event_t event, GVariant *params, void *userdata) } ((mm_sound_device_running_changed_wrapper_cb)(cb_data->user_cb))(device_id, device_type, direction, - state, name, vendor_id, product_id, is_running, stream_id, stream_num, cb_data->user_data); + state, name, vendor_id, product_id, (bool)is_running, stream_id, stream_num, cb_data->user_data); } else if (event == AUDIO_EVENT_FOCUS_CHANGED) { } else if (event == AUDIO_EVENT_FOCUS_WATCH) { } else if (event == AUDIO_EVENT_TEST) { diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 94b4433..8ecda7c 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.12.21 +Version: 0.12.22 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4