Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
44c64aef
Commit
44c64aef
authored
Nov 04, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Nov 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsock32: Correctly handle the case where a table size is 0 in IP_MIB_TABLE_ENTRY_ID.
Spotted by Gerald Pfeifer.
parent
fdc607d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
socket.c
dlls/wsock32/socket.c
+18
-6
No files found.
dlls/wsock32/socket.c
View file @
44c64aef
...
@@ -442,8 +442,12 @@ DWORD WINAPI WsControl(DWORD protocol,
...
@@ -442,8 +442,12 @@ DWORD WINAPI WsControl(DWORD protocol,
if
(
!
pcbResponseInfoLen
)
if
(
!
pcbResponseInfoLen
)
return
ERROR_BAD_ENVIRONMENT
;
return
ERROR_BAD_ENVIRONMENT
;
GetIpForwardTable
(
NULL
,
&
routeTableSize
,
FALSE
);
GetIpForwardTable
(
NULL
,
&
routeTableSize
,
FALSE
);
numRoutes
=
min
(
routeTableSize
-
sizeof
(
MIB_IPFORWARDTABLE
),
if
(
!
routeTableSize
)
{
0
)
/
sizeof
(
MIB_IPFORWARDROW
)
+
1
;
*
pcbResponseInfoLen
=
0
;
return
WSCTL_SUCCESS
;
}
numRoutes
=
(
routeTableSize
-
sizeof
(
MIB_IPFORWARDTABLE
))
/
sizeof
(
MIB_IPFORWARDROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
IPRouteEntry
)
*
numRoutes
)
if
(
*
pcbResponseInfoLen
<
sizeof
(
IPRouteEntry
)
*
numRoutes
)
return
(
ERROR_LOCK_VIOLATION
);
return
(
ERROR_LOCK_VIOLATION
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
routeTableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
routeTableSize
);
...
@@ -491,8 +495,12 @@ DWORD WINAPI WsControl(DWORD protocol,
...
@@ -491,8 +495,12 @@ DWORD WINAPI WsControl(DWORD protocol,
if
(
!
pcbResponseInfoLen
)
if
(
!
pcbResponseInfoLen
)
return
ERROR_BAD_ENVIRONMENT
;
return
ERROR_BAD_ENVIRONMENT
;
GetIpNetTable
(
NULL
,
&
arpTableSize
,
FALSE
);
GetIpNetTable
(
NULL
,
&
arpTableSize
,
FALSE
);
numEntries
=
min
(
arpTableSize
-
sizeof
(
MIB_IPNETTABLE
),
if
(
!
arpTableSize
)
{
0
)
/
sizeof
(
MIB_IPNETROW
)
+
1
;
*
pcbResponseInfoLen
=
0
;
return
WSCTL_SUCCESS
;
}
numEntries
=
(
arpTableSize
-
sizeof
(
MIB_IPNETTABLE
))
/
sizeof
(
MIB_IPNETROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_IPNETROW
)
*
numEntries
)
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_IPNETROW
)
*
numEntries
)
return
(
ERROR_LOCK_VIOLATION
);
return
(
ERROR_LOCK_VIOLATION
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
arpTableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
arpTableSize
);
...
@@ -529,8 +537,12 @@ DWORD WINAPI WsControl(DWORD protocol,
...
@@ -529,8 +537,12 @@ DWORD WINAPI WsControl(DWORD protocol,
if
(
!
pcbResponseInfoLen
)
if
(
!
pcbResponseInfoLen
)
return
ERROR_BAD_ENVIRONMENT
;
return
ERROR_BAD_ENVIRONMENT
;
GetTcpTable
(
NULL
,
&
tcpTableSize
,
FALSE
);
GetTcpTable
(
NULL
,
&
tcpTableSize
,
FALSE
);
numEntries
=
min
(
tcpTableSize
-
sizeof
(
MIB_TCPTABLE
),
if
(
!
tcpTableSize
)
{
0
)
/
sizeof
(
MIB_TCPROW
)
+
1
;
*
pcbResponseInfoLen
=
0
;
return
WSCTL_SUCCESS
;
}
numEntries
=
(
tcpTableSize
-
sizeof
(
MIB_TCPTABLE
))
/
sizeof
(
MIB_TCPROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_TCPROW
)
*
numEntries
)
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_TCPROW
)
*
numEntries
)
return
(
ERROR_LOCK_VIOLATION
);
return
(
ERROR_LOCK_VIOLATION
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
tcpTableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
tcpTableSize
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment