X11 : fix crash in Handle_SelectionNotify() when Clipboard cannot be converted to UTF8_STRING
This commit is contained in:
parent
75210cfe7c
commit
a68343d2ad
11
src/input.c
11
src/input.c
@ -478,6 +478,12 @@ static int Handle_SelectionNotify(const XSelectionEvent* xselection)
|
|||||||
unsigned long count = 0, bytesAfter = 0;
|
unsigned long count = 0, bytesAfter = 0;
|
||||||
unsigned char * value = NULL;
|
unsigned char * value = NULL;
|
||||||
|
|
||||||
|
GFX2_Log(GFX2_DEBUG, "xselection: selection=%s property=%s target=%s\n",
|
||||||
|
XGetAtomName(X11_display, xselection->selection),
|
||||||
|
xselection->property == None ? "None" : XGetAtomName(X11_display, xselection->property),
|
||||||
|
XGetAtomName(X11_display, xselection->target));
|
||||||
|
if (xselection->property != None)
|
||||||
|
{
|
||||||
r = XGetWindowProperty(X11_display, X11_window, xselection->property, 0, LONG_MAX,
|
r = XGetWindowProperty(X11_display, X11_window, xselection->property, 0, LONG_MAX,
|
||||||
False, xselection->target /* type */, &type, &format,
|
False, xselection->target /* type */, &type, &format,
|
||||||
&count, &bytesAfter, &value);
|
&count, &bytesAfter, &value);
|
||||||
@ -489,6 +495,11 @@ static int Handle_SelectionNotify(const XSelectionEvent* xselection)
|
|||||||
user_feedback_required = 1;
|
user_feedback_required = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
GFX2_Log(GFX2_INFO, "X11 Selection conversion failed\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
GFX2_Log(GFX2_INFO, "Unhandled SelectNotify selection=%s\n", XGetAtomName(X11_display, xselection->selection));
|
GFX2_Log(GFX2_INFO, "Unhandled SelectNotify selection=%s\n", XGetAtomName(X11_display, xselection->selection));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user