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
d5c745e4
Commit
d5c745e4
authored
Nov 08, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Don't use fixed size buffer in ctl2_encode_string.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
908c2bec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
write_msft.c
tools/widl/write_msft.c
+8
-4
No files found.
tools/widl/write_msft.c
View file @
d5c745e4
...
...
@@ -342,11 +342,14 @@ static int ctl2_encode_string(
const
char
*
string
,
/* [I] The string to encode. */
char
**
result
)
/* [O] A pointer to a pointer to receive the encoded string. */
{
int
length
;
s
tatic
char
converted_string
[
0x104
]
;
char
*
converted_string
;
s
ize_t
length
,
size
;
int
offset
;
length
=
strlen
(
string
);
size
=
(
length
+
5
)
&
~
3
;
if
(
length
<
3
)
size
+=
4
;
converted_string
=
xmalloc
(
size
);
memcpy
(
converted_string
+
2
,
string
,
length
);
#ifdef WORDS_BIGENDIAN
...
...
@@ -365,8 +368,7 @@ static int ctl2_encode_string(
for
(
offset
=
(
4
-
(
length
+
2
))
&
3
;
offset
;
offset
--
)
converted_string
[
length
+
offset
+
1
]
=
0x57
;
*
result
=
converted_string
;
return
(
length
+
5
)
&
~
3
;
return
size
;
}
/****************************************************************************
...
...
@@ -604,6 +606,7 @@ static int ctl2_alloc_string(
string_space
=
typelib
->
typelib_segment_data
[
MSFT_SEG_STRING
]
+
offset
;
memcpy
(
string_space
,
encoded_string
,
length
);
free
(
encoded_string
);
return
offset
;
}
...
...
@@ -684,6 +687,7 @@ static int alloc_importfile(
importfile
->
lcid
=
typelib
->
typelib_header
.
lcid2
;
importfile
->
version
=
major_version
|
(
minor_version
<<
16
);
memcpy
(
&
importfile
->
filename
,
encoded_string
,
length
);
free
(
encoded_string
);
return
offset
;
}
...
...
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