Ignore:
Timestamp:
Feb 27, 2013 2:26:03 PM (11 years ago)
Author:
riza
Message:

Re #1609: backported to 1.x

Location:
pjproject/branches/1.x
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x

  • pjproject/branches/1.x/pjsip/src/pjsip/sip_auth_client.c

    r3954 r4399  
    921921         */ 
    922922        unsigned i; 
    923         char *uri_str; 
    924         int len; 
    925  
    926         uri_str = (char*)pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE); 
    927         len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, tdata->msg->line.req.uri, 
    928                               uri_str, PJSIP_MAX_URL_SIZE); 
    929         if (len < 1 || len >= PJSIP_MAX_URL_SIZE) 
     923        pj_str_t uri; 
     924 
     925        uri.ptr = (char*)pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE); 
     926        uri.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 
     927                                  tdata->msg->line.req.uri, 
     928                                   uri.ptr, PJSIP_MAX_URL_SIZE); 
     929        if (uri.slen < 1 || uri.slen >= PJSIP_MAX_URL_SIZE) 
    930930            return PJSIP_EURITOOLONG; 
    931931 
     
    947947                pj_strdup(tdata->pool, &hs->credential.digest.realm, 
    948948                          &c->realm); 
    949                 pj_strdup2(tdata->pool, &hs->credential.digest.uri, 
    950                            uri_str); 
     949                pj_strdup(tdata->pool, &hs->credential.digest.uri, &uri); 
    951950                pj_strdup(tdata->pool, &hs->credential.digest.algorithm, 
    952951                          &sess->pref.algorithm); 
  • pjproject/branches/1.x/pjsip/src/pjsip/sip_tel_uri.c

    r3553 r4399  
    183183    int printed; 
    184184    char *startbuf = buf; 
    185     char *endbuf = buf+size; 
     185    char *endbuf = buf+size-1; 
    186186    const pjsip_parser_const_t *pc = pjsip_parser_const(); 
    187187 
     
    217217        return -1; 
    218218    buf += printed; 
     219 
     220    *buf = '\0'; 
    219221 
    220222    return (buf-startbuf); 
Note: See TracChangeset for help on using the changeset viewer.