提交 281f88ae authored 作者: Mathieu Parent's avatar Mathieu Parent

Skinny: Don't do backspace if destination number is already empty

This fix a out of bound memory write.
(normally unreachable with a real phone)
上级 de498aef
...@@ -271,7 +271,7 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list ...@@ -271,7 +271,7 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
if (strlen(tech_pvt->caller_profile->destination_number) == 0) {/* no digit yet */ if (strlen(tech_pvt->caller_profile->destination_number) == 0) {/* no digit yet */
send_start_tone(listener, SKINNY_TONE_DIALTONE, 0, line_instance, tech_pvt->call_id); send_start_tone(listener, SKINNY_TONE_DIALTONE, 0, line_instance, tech_pvt->call_id);
} }
if (backspace) { /* backspace */ if (backspace && strlen(tech_pvt->caller_profile->destination_number)) { /* backspace */
tech_pvt->caller_profile->destination_number[strlen(tech_pvt->caller_profile->destination_number)-1] = '\0'; tech_pvt->caller_profile->destination_number[strlen(tech_pvt->caller_profile->destination_number)-1] = '\0';
if (strlen(tech_pvt->caller_profile->destination_number) == 0) { if (strlen(tech_pvt->caller_profile->destination_number) == 0) {
send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_OFF_HOOK, 0xffff); send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_OFF_HOOK, 0xffff);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论