Changeset 2819


Ignore:
Timestamp:
Jun 25, 2009 1:29:52 PM (10 years ago)
Author:
bennylp
Message:

Ticket #773 (misc fixes): backported changes from #838:

  • from r2749: protect pj_strdup() for case when source and destination string are the same pointer. Without this, destination string will contain garbage value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0/pjlib/include/pj/string_i.h

    r2394 r2819  
    3333                              const pj_str_t *src) 
    3434{ 
     35    /* Without this, destination will be corrupted */ 
     36    if (dst == src) 
     37        return dst; 
     38 
    3539    if (src->slen) { 
    3640        dst->ptr = (char*)pj_pool_alloc(pool, src->slen); 
Note: See TracChangeset for help on using the changeset viewer.