diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-04-14 08:55:39 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-04-14 08:55:39 +0000 |
commit | 3b22580e559c2c649d7f2888b3bc45227f507641 (patch) | |
tree | 42ecda0bc06181a714c3f454ea47622af95c8480 | |
parent | 45713962e13efef0d2f773c142106b38837a1749 (diff) |
Fixed bug: credentials are not copied properly in set_credentials()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@401 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_auth_client.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c index 172ba719..1c2a5570 100644 --- a/pjsip/src/pjsip/sip_auth_client.c +++ b/pjsip/src/pjsip/sip_auth_client.c @@ -399,8 +399,15 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *sess, if (cred_cnt == 0) { sess->cred_cnt = 0; } else { + int i; sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c)); - pj_memcpy(sess->cred_info, c, cred_cnt * sizeof(*c)); + for (i=0; i<cred_cnt; ++i) { + sess->cred_info[i].data_type = c[i].data_type; + pj_strdup(sess->pool, &sess->cred_info[i].scheme, &c[i].scheme); + pj_strdup(sess->pool, &sess->cred_info[i].realm, &c[i].realm); + pj_strdup(sess->pool, &sess->cred_info[i].username, &c[i].username); + pj_strdup(sess->pool, &sess->cred_info[i].data, &c[i].data); + } sess->cred_cnt = cred_cnt; } |