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
8d21f998
Commit
8d21f998
authored
Nov 05, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix handling of strings with embedded nulls in msi_addstring.
parent
aeb5950e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
string.c
dlls/msi/string.c
+5
-10
No files found.
dlls/msi/string.c
View file @
8d21f998
...
...
@@ -258,14 +258,12 @@ static UINT msi_string2idA( const string_table *st, LPCSTR buffer, UINT *id )
return
r
;
}
static
int
msi_addstring
(
string_table
*
st
,
UINT
n
,
const
CHAR
*
data
,
int
len
,
USHORT
refcount
,
enum
StringPersistence
persistence
)
static
int
msi_addstring
(
string_table
*
st
,
UINT
n
,
const
char
*
data
,
UINT
len
,
USHORT
refcount
,
enum
StringPersistence
persistence
)
{
LPWSTR
str
;
int
sz
;
if
(
!
data
)
return
0
;
if
(
!
data
[
0
]
)
if
(
!
data
||
!
len
)
return
0
;
if
(
n
>
0
)
{
...
...
@@ -295,8 +293,6 @@ static int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, U
}
/* allocate a new string */
if
(
len
<
0
)
len
=
strlen
(
data
);
sz
=
MultiByteToWideChar
(
st
->
codepage
,
0
,
data
,
len
,
NULL
,
0
);
str
=
msi_alloc
(
(
sz
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
str
)
...
...
@@ -305,7 +301,6 @@ static int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, U
str
[
sz
]
=
0
;
set_st_entry
(
st
,
n
,
str
,
sz
,
refcount
,
persistence
);
return
n
;
}
...
...
@@ -316,6 +311,9 @@ int msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcoun
if
(
!
data
)
return
0
;
if
(
len
<
0
)
len
=
strlenW
(
data
);
if
(
!
data
[
0
]
&&
!
len
)
return
0
;
...
...
@@ -333,8 +331,6 @@ int msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcoun
return
-
1
;
/* allocate a new string */
if
(
len
<
0
)
len
=
strlenW
(
data
);
TRACE
(
"%s, n = %d len = %d
\n
"
,
debugstr_wn
(
data
,
len
),
n
,
len
);
str
=
msi_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
...
...
@@ -344,7 +340,6 @@ int msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcoun
str
[
len
]
=
0
;
set_st_entry
(
st
,
n
,
str
,
len
,
refcount
,
persistence
);
return
n
;
}
...
...
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