diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-04-02 12:15:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-04-02 12:15:23 +0000 |
commit | 81dc9bb9f4abbf6f13794af9808734815c6acee5 (patch) | |
tree | 73ce372a58a043aaec3ca518139c9b7eaa1e3695 /pjsip-apps/src | |
parent | 6a707e80e4a96a0607b44845582407bb47caa9b6 (diff) |
Misc (ticket #772): bug in pjsua application when reading the URL from the buddy list, causing corrupt/invalid URI to be returned
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2566 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index 11c4d27b..87cb749f 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -3131,14 +3131,16 @@ void console_app_main(const pj_str_t *uri_to_call) } else { pjsua_buddy_info binfo; pjsua_buddy_get_info(result.nb_result-1, &binfo); - uri = binfo.uri.ptr; + tmp.ptr = buf; + pj_strncpy(&tmp, &binfo.uri, sizeof(buf)); } } else if (result.uri_result) { - uri = result.uri_result; + tmp = pj_str(result.uri_result); + } else { + tmp.slen = 0; } - tmp = pj_str(uri); pjsua_call_make_call( current_acc, &tmp, 0, NULL, NULL, NULL); break; @@ -3162,15 +3164,15 @@ void console_app_main(const pj_str_t *uri_to_call) continue; } pjsua_buddy_get_info(result.nb_result-1, &binfo); - uri = binfo.uri.ptr; + tmp.ptr = buf; + pj_strncpy(&tmp, &binfo.uri, sizeof(buf)); } else { - uri = result.uri_result; + tmp = pj_str(result.uri_result); } for (i=0; i<my_atoi(menuin); ++i) { pj_status_t status; - tmp = pj_str(uri); status = pjsua_call_make_call(current_acc, &tmp, 0, NULL, NULL, NULL); if (status != PJ_SUCCESS) @@ -3208,7 +3210,9 @@ void console_app_main(const pj_str_t *uri_to_call) } else { pjsua_buddy_info binfo; pjsua_buddy_get_info(result.nb_result-1, &binfo); - uri = binfo.uri.ptr; + tmp.ptr = buf; + pj_strncpy_with_null(&tmp, &binfo.uri, sizeof(buf)); + uri = buf; } } else if (result.uri_result) { @@ -3765,7 +3769,9 @@ void console_app_main(const pj_str_t *uri_to_call) } else { pjsua_buddy_info binfo; pjsua_buddy_get_info(result.nb_result-1, &binfo); - uri = binfo.uri.ptr; + tmp.ptr = buf; + pj_strncpy_with_null(&tmp, &binfo.uri, sizeof(buf)); + uri = buf; } } else if (result.uri_result) { |