Changeset 3037


Ignore:
Timestamp:
Dec 29, 2009 4:53:33 PM (10 years ago)
Author:
bennylp
Message:

Fixed ticket #1007: Heap corruption when socket address with invalid address family is given (thanks Emil Sturniolo for the report)

File:
1 edited

Legend:

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

    r2966 r3037  
    339339     */ 
    340340    //PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || 
    341     //               a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); 
     341    //               a->addr.sa_family == PJ_AF_INET6, PJ_FALSE); 
    342342 
    343343    if (a->addr.sa_family!=PJ_AF_INET && a->addr.sa_family!=PJ_AF_INET6) { 
     
    373373    const pj_sockaddr *a = (const pj_sockaddr*) addr; 
    374374    PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || 
    375                      a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); 
     375                     a->addr.sa_family == PJ_AF_INET6, 0); 
    376376    return a->addr.sa_family == PJ_AF_INET6 ? 
    377377            sizeof(pj_in6_addr) : sizeof(pj_in_addr); 
     
    385385    const pj_sockaddr *a = (const pj_sockaddr*) addr; 
    386386    PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || 
    387                      a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); 
     387                     a->addr.sa_family == PJ_AF_INET6, 0); 
    388388    return a->addr.sa_family == PJ_AF_INET6 ? 
    389389            sizeof(pj_sockaddr_in6) : sizeof(pj_sockaddr_in); 
Note: See TracChangeset for help on using the changeset viewer.