diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-03-30 18:54:46 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-03-30 18:54:46 +0000 |
commit | 1538435474d8e74d17bac0bd869442f5030c5622 (patch) | |
tree | d74e695857fb6a46f2a42fdef2e706d6888fd18f /pjlib/src | |
parent | e2d3f7f9eda19501323d1c772ec4e4f74cc77e42 (diff) |
Fixed not enough buffer error with IP helper on XP SP2
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1119 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src')
-rw-r--r-- | pjlib/src/pj/ip_helper_win32.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pjlib/src/pj/ip_helper_win32.c b/pjlib/src/pj/ip_helper_win32.c index b690e4f9..6256e59c 100644 --- a/pjlib/src/pj/ip_helper_win32.c +++ b/pjlib/src/pj/ip_helper_win32.c @@ -44,7 +44,7 @@ PJ_DEF(pj_status_t) pj_enum_ip_interface(unsigned *p_cnt, /* Provide enough buffer or otherwise it will fail with * error 22 ("Not Enough Buffer") error. */ - MIB_IPADDRTABLE ipTabBuff[4]; + char ipTabBuff[1024]; MIB_IPADDRTABLE *pTab; ULONG tabSize; unsigned i, count; @@ -52,11 +52,11 @@ PJ_DEF(pj_status_t) pj_enum_ip_interface(unsigned *p_cnt, PJ_ASSERT_RETURN(p_cnt && ifs, PJ_EINVAL); - pTab = ipTabBuff; + pTab = (MIB_IPADDRTABLE*)ipTabBuff; /* Get IP address table */ tabSize = sizeof(ipTabBuff); - rc = GetIpAddrTable(ipTabBuff, &tabSize, FALSE); + rc = GetIpAddrTable(pTab, &tabSize, FALSE); if (rc != NO_ERROR) return PJ_RETURN_OS_ERROR(rc); @@ -85,9 +85,9 @@ PJ_DEF(pj_status_t) pj_enum_ip_interface(unsigned *p_cnt, PJ_DEF(pj_status_t) pj_enum_ip_route(unsigned *p_cnt, pj_ip_route_entry routes[]) { - MIB_IPADDRTABLE ipTabBuff[4]; + char ipTabBuff[1024]; MIB_IPADDRTABLE *pIpTab; - MIB_IPFORWARDTABLE rtabBuff[4]; + char rtabBuff[1024]; MIB_IPFORWARDTABLE *prTab; ULONG tabSize; unsigned i, count; @@ -95,18 +95,18 @@ PJ_DEF(pj_status_t) pj_enum_ip_route(unsigned *p_cnt, PJ_ASSERT_RETURN(p_cnt && routes, PJ_EINVAL); - pIpTab = ipTabBuff; - prTab = rtabBuff; + pIpTab = (MIB_IPADDRTABLE *)ipTabBuff; + prTab = (MIB_IPFORWARDTABLE *)rtabBuff; /* First get IP address table */ tabSize = sizeof(ipTabBuff); - rc = GetIpAddrTable(ipTabBuff, &tabSize, FALSE); + rc = GetIpAddrTable(pIpTab, &tabSize, FALSE); if (rc != NO_ERROR) return PJ_RETURN_OS_ERROR(rc); /* Next get IP route table */ tabSize = sizeof(rtabBuff); - rc = GetIpForwardTable(rtabBuff, &tabSize, 1); + rc = GetIpForwardTable(prTab, &tabSize, 1); if (rc != NO_ERROR) return PJ_RETURN_OS_ERROR(rc); |