Add missing NULL check for c-string variable 32/229432/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 1 Apr 2020 05:28:20 +0000 (14:28 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 2 Apr 2020 03:13:43 +0000 (12:13 +0900)
Change-Id: I2493b8760fb18132bb1d47cf961be706d226defe

src/multi_assistant_service.c

index 1375661467ecfa738925d6bb2f0ed5672a16de71..4f8ef696ab108f09ecd47088dbc9c32eefd182cf 100644 (file)
@@ -1203,7 +1203,8 @@ int mas_update_voice_key_support_mode()
        if (0 == multi_assistant_service_plugin_get_default_assistant(&default_assistant)) {
                for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
                        if (g_maclient_info[loop].used) {
-                               if (strncmp(default_assistant, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
+                               if (default_assistant &&
+                                       strncmp(default_assistant, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
                                        float duration = g_maclient_info[loop].voice_key_tap_duration;
                                        if (0.0f < duration) {
                                                multi_assistant_service_plugin_set_voice_key_tap_duration(duration);