Changeset 1119 for pjproject


Ignore:
Timestamp:
Mar 30, 2007 6:54:46 PM (18 years ago)
Author:
bennylp
Message:

Fixed not enough buffer error with IP helper on XP SP2

File:
1 edited

Legend:

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

    r1111 r1119  
    4545     * error 22 ("Not Enough Buffer") error. 
    4646     */ 
    47     MIB_IPADDRTABLE ipTabBuff[4]; 
     47    char ipTabBuff[1024]; 
    4848    MIB_IPADDRTABLE *pTab; 
    4949    ULONG tabSize; 
     
    5353    PJ_ASSERT_RETURN(p_cnt && ifs, PJ_EINVAL); 
    5454 
    55     pTab = ipTabBuff; 
     55    pTab = (MIB_IPADDRTABLE*)ipTabBuff; 
    5656 
    5757    /* Get IP address table */ 
    5858    tabSize = sizeof(ipTabBuff); 
    59     rc = GetIpAddrTable(ipTabBuff, &tabSize, FALSE); 
     59    rc = GetIpAddrTable(pTab, &tabSize, FALSE); 
    6060    if (rc != NO_ERROR) 
    6161        return PJ_RETURN_OS_ERROR(rc); 
     
    8686                                     pj_ip_route_entry routes[]) 
    8787{ 
    88     MIB_IPADDRTABLE ipTabBuff[4]; 
     88    char ipTabBuff[1024]; 
    8989    MIB_IPADDRTABLE *pIpTab; 
    90     MIB_IPFORWARDTABLE rtabBuff[4]; 
     90    char rtabBuff[1024]; 
    9191    MIB_IPFORWARDTABLE *prTab; 
    9292    ULONG tabSize; 
     
    9696    PJ_ASSERT_RETURN(p_cnt && routes, PJ_EINVAL); 
    9797 
    98     pIpTab = ipTabBuff; 
    99     prTab = rtabBuff; 
     98    pIpTab = (MIB_IPADDRTABLE *)ipTabBuff; 
     99    prTab = (MIB_IPFORWARDTABLE *)rtabBuff; 
    100100 
    101101    /* First get IP address table */ 
    102102    tabSize = sizeof(ipTabBuff); 
    103     rc = GetIpAddrTable(ipTabBuff, &tabSize, FALSE); 
     103    rc = GetIpAddrTable(pIpTab, &tabSize, FALSE); 
    104104    if (rc != NO_ERROR) 
    105105        return PJ_RETURN_OS_ERROR(rc); 
     
    107107    /* Next get IP route table */ 
    108108    tabSize = sizeof(rtabBuff); 
    109     rc = GetIpForwardTable(rtabBuff, &tabSize, 1); 
     109    rc = GetIpForwardTable(prTab, &tabSize, 1); 
    110110    if (rc != NO_ERROR) 
    111111        return PJ_RETURN_OS_ERROR(rc); 
Note: See TracChangeset for help on using the changeset viewer.