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/pjsip/include/pjsip/print_util.h

    r5237 r5468  
    3030        do { \ 
    3131            if ((str).slen >= (endbuf-buf)) return -1;  \ 
    32             pj_memcpy(buf, (str).ptr, (str).slen); \ 
    33             buf += (str).slen; \ 
     32            if ((str).slen) { \ 
     33                pj_memcpy(buf, (str).ptr, (str).slen); \ 
     34                buf += (str).slen; \ 
     35            } \ 
    3436        } while (0) 
    3537 
Note: See TracChangeset for help on using the changeset viewer.