mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05: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.
This commit is contained in:
parent
f60547ac80
commit
23e6e8e4b7
|
@ -290,6 +290,7 @@ information on what to include when reporting a bug.
|
||||||
- [X11] Bugfix: Dynamic loading on NetBSD failed due to soname differences
|
- [X11] Bugfix: Dynamic loading on NetBSD failed due to soname differences
|
||||||
- [X11] Bugfix: Left shift of int constant relied on undefined behavior (#1951)
|
- [X11] Bugfix: Left shift of int constant relied on undefined behavior (#1951)
|
||||||
- [X11] Bugfix: The OSMesa libray was 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 dynamic loading of all Wayland libraries
|
- [Wayland] Added dynamic loading of all Wayland libraries
|
||||||
- [Wayland] Added support for key names via xkbcommon
|
- [Wayland] Added support for key names via xkbcommon
|
||||||
- [Wayland] Added support for file path drop events (#2040)
|
- [Wayland] Added support for file path drop events (#2040)
|
||||||
|
|
|
@ -984,6 +984,8 @@ static const char* getSelectionString(Atom selection)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!itemCount)
|
if (!itemCount)
|
||||||
|
{
|
||||||
|
if (string)
|
||||||
{
|
{
|
||||||
if (targets[i] == XA_STRING)
|
if (targets[i] == XA_STRING)
|
||||||
{
|
{
|
||||||
|
@ -992,6 +994,7 @@ static const char* getSelectionString(Atom selection)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*selectionString = string;
|
*selectionString = string;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user