Ignore:
Timestamp:
Oct 24, 2016 3:22:46 AM (4 years ago)
Author:
nanang
Message:

Misc (re #1945): Avoid calling memchr() or memcpy() with NULL pointer (thanks Kal from the patch).

File:
1 edited

Legend:

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

    r5229 r5468  
    121121    pj_assert(max >= 0); 
    122122    if (max > src->slen) max = src->slen; 
    123     pj_memcpy(dst->ptr, src->ptr, max); 
     123    if (max > 0) 
     124        pj_memcpy(dst->ptr, src->ptr, max); 
    124125    dst->slen = max; 
    125126    return dst; 
Note: See TracChangeset for help on using the changeset viewer.