Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
08941174
Commit
08941174
authored
18 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msi: Fix strings with lengths that are exact multiples of 2^16.
parent
f667c06a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/msi/table.c
+29
-16
29 additions, 16 deletions
dlls/msi/table.c
with
29 additions
and
16 deletions
dlls/msi/table.c
+
29
−
16
View file @
08941174
...
...
@@ -686,7 +686,7 @@ string_table *load_string_table( IStorage *stg )
CHAR
*
data
=
NULL
;
USHORT
*
pool
=
NULL
;
UINT
r
,
datasize
=
0
,
poolsize
=
0
,
codepage
;
DWORD
i
,
count
,
offset
,
len
,
n
;
DWORD
i
,
count
,
offset
,
len
,
n
,
refs
;
static
const
WCHAR
szStringData
[]
=
{
'_'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
szStringPool
[]
=
{
...
...
@@ -708,38 +708,51 @@ string_table *load_string_table( IStorage *stg )
offset
=
0
;
n
=
1
;
for
(
i
=
1
;
i
<
count
;
i
++
)
i
=
1
;
while
(
i
<
count
)
{
len
=
pool
[
i
*
2
];
/* the string reference count is always the second word */
refs
=
pool
[
i
*
2
+
1
];
/* empty entries have two zeros, still have a string id */
if
(
pool
[
i
*
2
]
==
0
&&
refs
==
0
)
{
i
++
;
n
++
;
continue
;
}
/*
* If a string is over 64k, the previous string entry is made null
* and its the high word of the length is inserted in the null string's
* reference count field.
*/
if
(
pool
[
i
*
2
-
2
]
==
0
&&
pool
[
i
*
2
-
1
]
)
len
+=
pool
[
i
*
2
+
1
]
*
0x10000
;
if
(
(
offset
+
len
)
>
datasize
)
if
(
pool
[
i
*
2
]
==
0
)
{
ERR
(
"string table corrupt?
\n
"
);
break
;
len
=
(
pool
[
i
*
2
+
3
]
<<
16
)
+
pool
[
i
*
2
+
2
];
i
+=
2
;
}
else
{
len
=
pool
[
i
*
2
];
i
+=
1
;
}
/* don't add the high word of a string's length as a string */
if
(
len
||
!
pool
[
i
*
2
+
1
]
)
if
(
(
offset
+
len
)
>
datasize
)
{
r
=
msi_addstring
(
st
,
n
,
data
+
offset
,
len
,
pool
[
i
*
2
+
1
]
);
if
(
r
!=
n
)
ERR
(
"Failed to add string %ld
\n
"
,
n
);
n
++
;
ERR
(
"string table corrupt?
\n
"
);
break
;
}
r
=
msi_addstring
(
st
,
n
,
data
+
offset
,
len
,
refs
);
if
(
r
!=
n
)
ERR
(
"Failed to add string %ld
\n
"
,
n
);
n
++
;
offset
+=
len
;
}
if
(
datasize
!=
offset
)
ERR
(
"string table load failed! (%08x != %08lx)
\n
"
,
datasize
,
offset
);
ERR
(
"string table load failed! (%08x != %08lx)
, please report
\n
"
,
datasize
,
offset
);
TRACE
(
"Loaded %ld strings
\n
"
,
count
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment