Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
31f0509b
Commit
31f0509b
authored
Feb 03, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hnetcfg: Handle NULL strings in update_mapping_list().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d907c895
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
port.c
dlls/hnetcfg/port.c
+22
-9
No files found.
dlls/hnetcfg/port.c
View file @
31f0509b
...
...
@@ -540,6 +540,22 @@ static LONG long_from_bstr( BSTR s )
return
_wtoi
(
s
);
}
static
BSTR
mapping_move_bstr
(
BSTR
*
s
)
{
BSTR
ret
;
if
(
*
s
)
{
ret
=
*
s
;
*
s
=
NULL
;
}
else
if
(
!
(
ret
=
SysAllocString
(
L""
)))
{
ERR
(
"No memory.
\n
"
);
}
return
ret
;
}
static
void
update_mapping_list
(
void
)
{
struct
xml_value_desc
mapping_desc
[
ARRAY_SIZE
(
port_mapping_template
)];
...
...
@@ -579,20 +595,17 @@ static void update_mapping_list(void)
}
break
;
}
new_mappings
[
index
].
external_ip
=
mapping_desc
[
PM_EXTERNAL_IP
].
value
;
mapping_desc
[
PM_EXTERNAL_IP
].
value
=
NULL
;
new_mappings
[
index
].
external_ip
=
mapping_move_bstr
(
&
mapping_desc
[
PM_EXTERNAL_IP
].
value
);
new_mappings
[
index
].
external
=
long_from_bstr
(
mapping_desc
[
PM_EXTERNAL
].
value
);
new_mappings
[
index
].
protocol
=
mapping_desc
[
PM_PROTOCOL
].
value
;
mapping_desc
[
PM_PROTOCOL
].
value
=
NULL
;
new_mappings
[
index
].
protocol
=
mapping_move_bstr
(
&
mapping_desc
[
PM_PROTOCOL
].
value
);
new_mappings
[
index
].
internal
=
long_from_bstr
(
mapping_desc
[
PM_INTERNAL
].
value
);
new_mappings
[
index
].
client
=
mapping_
desc
[
PM_CLIENT
].
value
;
mapping_desc
[
PM_CLIENT
].
value
=
NULL
;
if
(
!
wcsicmp
(
mapping_desc
[
PM_ENABLED
].
value
,
L"true"
)
||
long_from_bstr
(
mapping_desc
[
PM_ENABLED
].
value
))
new_mappings
[
index
].
client
=
mapping_
move_bstr
(
&
mapping_desc
[
PM_CLIENT
].
value
)
;
if
(
mapping_desc
[
PM_ENABLED
].
value
&&
(
!
wcsicmp
(
mapping_desc
[
PM_ENABLED
].
value
,
L"true"
)
||
long_from_bstr
(
mapping_desc
[
PM_ENABLED
].
value
)
))
new_mappings
[
index
].
enabled
=
VARIANT_TRUE
;
else
new_mappings
[
index
].
enabled
=
VARIANT_FALSE
;
new_mappings
[
index
].
descr
=
mapping_desc
[
PM_DESC
].
value
;
mapping_desc
[
PM_DESC
].
value
=
NULL
;
new_mappings
[
index
].
descr
=
mapping_move_bstr
(
&
mapping_desc
[
PM_DESC
].
value
);
TRACE
(
"%s %s %s:%u -> %s:%u, enabled %d.
\n
"
,
debugstr_w
(
new_mappings
[
index
].
descr
),
debugstr_w
(
new_mappings
[
index
].
protocol
),
debugstr_w
(
new_mappings
[
index
].
external_ip
),
...
...
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