Changeset 2749 for pjproject


Ignore:
Timestamp:
Jun 4, 2009 10:08:16 PM (15 years ago)
Author:
bennylp
Message:

Misc (ticket #838):

  • 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/trunk/pjlib/include/pj/string_i.h

    r2394 r2749  
    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.