mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
X11: Fix segfault on malformed INCR response
The code assumed that at least some data would be received via the INCR
mechanism and that, as a result, the string buffer would be allocated.
Bug found by Clang static analysis.
(cherry picked from commit 23e6e8e4b7
)
This commit is contained in:
parent
946312fe93
commit
65b8c4a46b
@ -134,6 +134,7 @@ information on what to include when reporting a bug.
|
||||
- [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791)
|
||||
- [Cocoa] Bugfix: The EGL and OSMesa libraries were not unloaded on termination
|
||||
- [X11] Bugfix: The OSMesa libray was not unloaded on termination
|
||||
- [X11] Bugfix: A malformed response during selection transfer could cause a segfault
|
||||
- [Wayland] Added support for file path drop events (#2040)
|
||||
- [Wayland] Bugfix: `glfwSetClipboardString` would fail if set to result of
|
||||
`glfwGetClipboardString`
|
||||
|
@ -1048,6 +1048,8 @@ static const char* getSelectionString(Atom selection)
|
||||
}
|
||||
|
||||
if (!itemCount)
|
||||
{
|
||||
if (string)
|
||||
{
|
||||
if (targets[i] == XA_STRING)
|
||||
{
|
||||
@ -1056,6 +1058,7 @@ static const char* getSelectionString(Atom selection)
|
||||
}
|
||||
else
|
||||
*selectionString = string;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user