Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
704ac5a5
Commit
704ac5a5
authored
Apr 09, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Added an error handler to catch bad atoms in clipboard selections.
parent
10629e23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
clipboard.c
dlls/winex11.drv/clipboard.c
+13
-8
No files found.
dlls/winex11.drv/clipboard.c
View file @
704ac5a5
...
...
@@ -1728,6 +1728,11 @@ static BOOL X11DRV_CLIPBOARD_QueryTargets(Display *display, Window w, Atom selec
}
static
int
is_atom_error
(
Display
*
display
,
XErrorEvent
*
event
,
void
*
arg
)
{
return
(
event
->
error_code
==
BadAtom
);
}
/**************************************************************************
* X11DRV_CLIPBOARD_InsertSelectionProperties
*
...
...
@@ -1759,7 +1764,7 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p
lpFormat
=
X11DRV_CLIPBOARD_LookupProperty
(
lpFormat
,
properties
[
i
]);
}
}
else
else
if
(
properties
[
i
])
{
/* add it to the list of atoms that we don't know about yet */
if
(
!
atoms
)
atoms
=
HeapAlloc
(
GetProcessHeap
(),
0
,
...
...
@@ -1774,13 +1779,13 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p
char
**
names
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nb_atoms
*
sizeof
(
*
names
)
);
if
(
names
)
{
wine_tsx11_lock
(
);
/* FIXME: we're at the mercy of the app sending the event here.
* Currently if they send a bogus atom, we will crash.
* We should handle BadAtom errors gracefully in this call.
*/
XGetAtomNames
(
display
,
atoms
,
nb_atoms
,
names
)
;
wine_tsx11_unlock
();
X11DRV_expect_error
(
display
,
is_atom_error
,
NULL
);
if
(
!
XGetAtomNames
(
display
,
atoms
,
nb_atoms
,
names
))
nb_atoms
=
0
;
if
(
X11DRV_check_error
())
{
WARN
(
"got some bad atoms, ignoring
\n
"
);
nb_atoms
=
0
;
}
for
(
i
=
0
;
i
<
nb_atoms
;
i
++
)
{
WINE_CLIPFORMAT
*
lpFormat
;
...
...
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