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
4012cc07
Commit
4012cc07
authored
Dec 06, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Dec 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Protect against NULL ssa to prevent crashes in old native usp10.
parent
f92dcb33
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
edit.c
dlls/user32/edit.c
+21
-4
No files found.
dlls/user32/edit.c
View file @
4012cc07
...
@@ -830,7 +830,7 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
...
@@ -830,7 +830,7 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
*
after_wrap
=
(
line_def
->
ending
==
END_WRAP
);
*
after_wrap
=
(
line_def
->
ending
==
END_WRAP
);
return
line_index
+
line_def
->
net_length
;
return
line_index
+
line_def
->
net_length
;
}
}
if
(
x
<=
0
)
{
if
(
x
<=
0
||
!
line_def
->
ssa
)
{
if
(
after_wrap
)
if
(
after_wrap
)
*
after_wrap
=
FALSE
;
*
after_wrap
=
FALSE
;
return
line_index
;
return
line_index
;
...
@@ -863,6 +863,8 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
...
@@ -863,6 +863,8 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
EDIT_UpdateUniscribeData
(
es
,
NULL
,
0
);
EDIT_UpdateUniscribeData
(
es
,
NULL
,
0
);
if
(
es
->
x_offset
)
if
(
es
->
x_offset
)
{
{
if
(
es
->
ssa
)
{
if
(
es
->
x_offset
>=
get_text_length
(
es
))
if
(
es
->
x_offset
>=
get_text_length
(
es
))
{
{
const
SIZE
*
size
;
const
SIZE
*
size
;
...
@@ -871,9 +873,12 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
...
@@ -871,9 +873,12 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
}
}
ScriptStringCPtoX
(
es
->
ssa
,
es
->
x_offset
,
FALSE
,
&
xoff
);
ScriptStringCPtoX
(
es
->
ssa
,
es
->
x_offset
,
FALSE
,
&
xoff
);
}
}
else
xoff
=
0
;
}
if
(
x
<
0
)
if
(
x
<
0
)
{
{
if
(
x
+
xoff
>
0
)
if
(
x
+
xoff
>
0
||
!
es
->
ssa
)
{
{
ScriptStringXtoCP
(
es
->
ssa
,
x
+
xoff
,
&
index
,
&
trailing
);
ScriptStringXtoCP
(
es
->
ssa
,
x
+
xoff
,
&
index
,
&
trailing
);
if
(
trailing
)
index
++
;
if
(
trailing
)
index
++
;
...
@@ -892,11 +897,13 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
...
@@ -892,11 +897,13 @@ static INT EDIT_CharFromPos(EDITSTATE *es, INT x, INT y, LPBOOL after_wrap)
index
=
0
;
index
=
0
;
else
if
(
x
>
size
->
cx
)
else
if
(
x
>
size
->
cx
)
index
=
get_text_length
(
es
);
index
=
get_text_length
(
es
);
else
else
if
(
es
->
ssa
)
{
{
ScriptStringXtoCP
(
es
->
ssa
,
x
+
xoff
,
&
index
,
&
trailing
);
ScriptStringXtoCP
(
es
->
ssa
,
x
+
xoff
,
&
index
,
&
trailing
);
if
(
trailing
)
index
++
;
if
(
trailing
)
index
++
;
}
}
else
index
=
0
;
}
}
else
else
index
=
es
->
x_offset
;
index
=
es
->
x_offset
;
...
@@ -1062,6 +1069,9 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
...
@@ -1062,6 +1069,9 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
while
(
line_def
->
index
!=
li
)
while
(
line_def
->
index
!=
li
)
line_def
=
line_def
->
next
;
line_def
=
line_def
->
next
;
if
(
!
line_def
->
ssa
)
return
0
;
lw
=
line_def
->
width
;
lw
=
line_def
->
width
;
w
=
es
->
format_rect
.
right
-
es
->
format_rect
.
left
;
w
=
es
->
format_rect
.
right
-
es
->
format_rect
.
left
;
ScriptStringCPtoX
(
line_def
->
ssa
,
(
index
-
1
)
-
li
,
TRUE
,
&
x
);
ScriptStringCPtoX
(
line_def
->
ssa
,
(
index
-
1
)
-
li
,
TRUE
,
&
x
);
...
@@ -1077,6 +1087,8 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
...
@@ -1077,6 +1087,8 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
EDIT_UpdateUniscribeData
(
es
,
NULL
,
0
);
EDIT_UpdateUniscribeData
(
es
,
NULL
,
0
);
if
(
es
->
x_offset
)
if
(
es
->
x_offset
)
{
{
if
(
es
->
ssa
)
{
if
(
es
->
x_offset
>=
get_text_length
(
es
))
if
(
es
->
x_offset
>=
get_text_length
(
es
))
{
{
if
(
es
->
ssa
)
if
(
es
->
ssa
)
...
@@ -1090,6 +1102,9 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
...
@@ -1090,6 +1102,9 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
}
}
ScriptStringCPtoX
(
es
->
ssa
,
es
->
x_offset
,
FALSE
,
&
xoff
);
ScriptStringCPtoX
(
es
->
ssa
,
es
->
x_offset
,
FALSE
,
&
xoff
);
}
}
else
xoff
=
0
;
}
if
(
index
)
if
(
index
)
{
{
if
(
index
>=
get_text_length
(
es
))
if
(
index
>=
get_text_length
(
es
))
...
@@ -1103,8 +1118,10 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
...
@@ -1103,8 +1118,10 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
else
else
xi
=
0
;
xi
=
0
;
}
}
else
else
if
(
es
->
ssa
)
ScriptStringCPtoX
(
es
->
ssa
,
index
,
FALSE
,
&
xi
);
ScriptStringCPtoX
(
es
->
ssa
,
index
,
FALSE
,
&
xi
);
else
xi
=
0
;
}
}
x
=
xi
-
xoff
;
x
=
xi
-
xoff
;
...
...
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