Changeset 2207 for pjproject


Ignore:
Timestamp:
Aug 13, 2008 8:41:42 AM (16 years ago)
Author:
bennylp
Message:

pj_sockaddr_copy_addr() might raise assertion if destination address is not initialized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/sock_common.c

    r2039 r2207  
    385385                                    const pj_sockaddr *src) 
    386386{ 
    387     pj_memcpy(pj_sockaddr_get_addr(dst), 
    388               pj_sockaddr_get_addr(src), 
    389               pj_sockaddr_get_addr_len(src)); 
     387    /* Destination sockaddr might not be initialized */ 
     388    const char *srcbuf = (char*)pj_sockaddr_get_addr(src); 
     389    char *dstbuf = ((char*)dst) + (srcbuf - (char*)src); 
     390    pj_memcpy(dstbuf, srcbuf, pj_sockaddr_get_addr_len(src)); 
    390391} 
    391392 
Note: See TracChangeset for help on using the changeset viewer.