Changeset 2935 for pjproject/trunk


Ignore:
Timestamp:
Oct 9, 2009 1:17:56 PM (15 years ago)
Author:
bennylp
Message:

Ticket #966: Bad RPID <person> id attribute generation (thanks Filipe Figueiredo for the report)

  • make sure the id starts with letter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/rpid.c

    r2394 r2935  
    2222#include <pj/assert.h> 
    2323#include <pj/guid.h> 
     24#include <pj/pool.h> 
    2425#include <pj/string.h> 
    2526 
     
    147148    } else { 
    148149        pj_str_t person_id; 
    149         pj_create_unique_string(pool, &person_id); 
     150        /* xs:ID must start with letter */ 
     151        //pj_create_unique_string(pool, &person_id); 
     152        person_id.ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH+2); 
     153        person_id.ptr += 2; 
     154        pj_generate_unique_string(&person_id); 
     155        person_id.ptr -= 2; 
     156        person_id.ptr[0] = 'p'; 
     157        person_id.ptr[1] = 'j'; 
     158        person_id.slen += 2; 
     159 
    150160        attr = pj_xml_attr_new(pool, &ID, &person_id); 
    151161    } 
Note: See TracChangeset for help on using the changeset viewer.