Fix NULL dereference issue and uninitialized variable issue
[platform/core/connectivity/bluetooth-agent.git] / hf-agent / bluetooth-hf-agent.c
index 95a46b4..8c2857c 100755 (executable)
@@ -1639,7 +1639,7 @@ static int __bt_hf_agent_handler_xsat(bt_hf_agent_info_t *bt_hf_info,
        if (stop)
                msg = strtok_r(stop + 1, "\\", &save_ptr);
 
-       if (app_id || msg) {
+       if (app_id > 0 && msg) {
                if (app_id == 2 && strstr(msg, "READTXPOWER")) {
                        char cmd_buf[BT_HF_CMD_BUF_SIZE * 2] = {0, };
                        char power = __bt_hf_agent_get_tx_power(bt_hf_info->remote_addr);