Changeset 401


Ignore:
Timestamp:
Apr 14, 2006 8:55:39 AM (19 years ago)
Author:
bennylp
Message:

Fixed bug: credentials are not copied properly in set_credentials()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r315 r401  
    400400        sess->cred_cnt = 0; 
    401401    } else { 
     402        int i; 
    402403        sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c)); 
    403         pj_memcpy(sess->cred_info, c, cred_cnt * sizeof(*c)); 
     404        for (i=0; i<cred_cnt; ++i) { 
     405            sess->cred_info[i].data_type = c[i].data_type; 
     406            pj_strdup(sess->pool, &sess->cred_info[i].scheme, &c[i].scheme); 
     407            pj_strdup(sess->pool, &sess->cred_info[i].realm, &c[i].realm); 
     408            pj_strdup(sess->pool, &sess->cred_info[i].username, &c[i].username); 
     409            pj_strdup(sess->pool, &sess->cred_info[i].data, &c[i].data); 
     410        } 
    404411        sess->cred_cnt = cred_cnt; 
    405412    } 
Note: See TracChangeset for help on using the changeset viewer.