From 81dc9bb9f4abbf6f13794af9808734815c6acee5 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 2 Apr 2009 12:15:23 +0000 Subject: 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 --- pjsip-apps/src/pjsua/pjsua_app.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'pjsip-apps/src/pjsua') 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