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
54b75f3d
Commit
54b75f3d
authored
Dec 11, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Avoid sizeof on structs with a varlength array.
parent
f417dc1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
nbt.c
dlls/netapi32/nbt.c
+6
-8
No files found.
dlls/netapi32/nbt.c
View file @
54b75f3d
...
...
@@ -407,9 +407,8 @@ static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount,
{
if
(
queryData
->
cacheEntry
==
NULL
)
{
queryData
->
cacheEntry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
NBNameCacheEntry
)
+
(
answerCount
-
1
)
*
sizeof
(
DWORD
));
queryData
->
cacheEntry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
NBNameCacheEntry
,
addresses
[
answerCount
]));
if
(
queryData
->
cacheEntry
)
queryData
->
cacheEntry
->
numAddresses
=
0
;
else
...
...
@@ -541,8 +540,8 @@ static UCHAR NetBTinetResolve(const UCHAR name[NCBNAMSZ],
if
(
addr
!=
INADDR_NONE
)
{
*
cacheEntry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
NBNameCacheEntry
));
*
cacheEntry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
NBNameCacheEntry
,
addresses
[
1
]
));
if
(
*
cacheEntry
)
{
memcpy
((
*
cacheEntry
)
->
name
,
name
,
NCBNAMSZ
);
...
...
@@ -566,9 +565,8 @@ static UCHAR NetBTinetResolve(const UCHAR name[NCBNAMSZ],
;
if
(
host
->
h_addr_list
&&
host
->
h_addr_list
[
0
])
{
*
cacheEntry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
NBNameCacheEntry
)
+
(
i
-
1
)
*
sizeof
(
DWORD
));
*
cacheEntry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
NBNameCacheEntry
,
addresses
[
i
]));
if
(
*
cacheEntry
)
{
memcpy
((
*
cacheEntry
)
->
name
,
name
,
NCBNAMSZ
);
...
...
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