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
08643dc4
Commit
08643dc4
authored
Dec 16, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Jan 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Handle memory allocation failure in bidi_compute_bracket_pairs (cppcheck).
parent
a89975f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
bidi.c
dlls/dwrite/bidi.c
+11
-8
No files found.
dlls/dwrite/bidi.c
View file @
08643dc4
...
@@ -632,23 +632,27 @@ static BracketPair *bidi_compute_bracket_pairs(IsolatedRun *iso_run)
...
@@ -632,23 +632,27 @@ static BracketPair *bidi_compute_bracket_pairs(IsolatedRun *iso_run)
WCHAR
*
open_stack
;
WCHAR
*
open_stack
;
int
*
stack_index
;
int
*
stack_index
;
int
stack_top
=
iso_run
->
length
;
int
stack_top
=
iso_run
->
length
;
BracketPair
*
out
=
NULL
;
BracketPair
*
out
;
int
pair_count
=
0
;
int
pair_count
=
0
;
int
i
;
int
i
;
open_stack
=
malloc
(
sizeof
(
WCHAR
)
*
iso_run
->
length
);
open_stack
=
malloc
(
sizeof
(
WCHAR
)
*
iso_run
->
length
);
stack_index
=
malloc
(
sizeof
(
int
)
*
iso_run
->
length
);
stack_index
=
malloc
(
sizeof
(
int
)
*
iso_run
->
length
);
out
=
malloc
(
sizeof
(
BracketPair
)
*
iso_run
->
length
);
if
(
!
open_stack
||
!
stack_index
||
!
out
)
{
free
(
open_stack
);
free
(
stack_index
);
free
(
out
);
return
NULL
;
}
out
[
0
].
start
=
-
1
;
for
(
i
=
0
;
i
<
iso_run
->
length
;
i
++
)
{
for
(
i
=
0
;
i
<
iso_run
->
length
;
i
++
)
{
unsigned
short
ubv
=
get_table_entry_16
(
bidi_bracket_table
,
iso_run
->
item
[
i
].
ch
);
unsigned
short
ubv
=
get_table_entry_16
(
bidi_bracket_table
,
iso_run
->
item
[
i
].
ch
);
if
(
ubv
)
if
(
ubv
)
{
{
if
(
!
out
)
{
out
=
malloc
(
sizeof
(
BracketPair
));
out
[
0
].
start
=
-
1
;
}
if
((
ubv
>>
8
)
==
0
)
{
if
((
ubv
>>
8
)
==
0
)
{
stack_top
--
;
stack_top
--
;
open_stack
[
stack_top
]
=
iso_run
->
item
[
i
].
ch
+
(
signed
char
)(
ubv
&
0xff
);
open_stack
[
stack_top
]
=
iso_run
->
item
[
i
].
ch
+
(
signed
char
)(
ubv
&
0xff
);
...
@@ -668,7 +672,6 @@ static BracketPair *bidi_compute_bracket_pairs(IsolatedRun *iso_run)
...
@@ -668,7 +672,6 @@ static BracketPair *bidi_compute_bracket_pairs(IsolatedRun *iso_run)
out
[
pair_count
].
start
=
stack_index
[
j
];
out
[
pair_count
].
start
=
stack_index
[
j
];
out
[
pair_count
].
end
=
i
;
out
[
pair_count
].
end
=
i
;
pair_count
++
;
pair_count
++
;
out
=
realloc
(
out
,
sizeof
(
BracketPair
)
*
(
pair_count
+
1
));
out
[
pair_count
].
start
=
-
1
;
out
[
pair_count
].
start
=
-
1
;
stack_top
=
j
+
1
;
stack_top
=
j
+
1
;
break
;
break
;
...
...
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