summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2017-03-13 20:01:27 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2017-03-15 09:46:09 +1000
commitba7321b6a52726cdb9964b82c5111518dc1f437d (patch)
treed2923b7e5f5b184f8971f62495a8c419af355a15 /src
parenta77be15825c0e450dac84619bda966d9fa9af6ec (diff)
downloadxorg-lib-libXaw-ba7321b6a52726cdb9964b82c5111518dc1f437d.tar.gz
NULL pointer dereference in XawAsciiSinkInitialize
The function XawAsciiSinkInitialize is prone to a NULL pointer dereference if no font is available. Even though a specific check for a NULL font exists, it is called after GetGC(), which in turn would trigger the NPE in such a case. Spotted by calling xmessage on a system with an incomplete x font setup: $ xmessage -b text Warning: Unable to load any usable ISO8859 font Segmentation fault $ _ Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/AsciiSink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/AsciiSink.c b/src/AsciiSink.c
index d776895..1cccb1c 100644
--- a/src/AsciiSink.c
+++ b/src/AsciiSink.c
@@ -1704,10 +1704,10 @@ XawAsciiSinkInitialize(Widget request, Widget cnew,
{
AsciiSinkObject sink = (AsciiSinkObject)cnew;
- GetGC(sink);
-
if (!sink->ascii_sink.font) XtError("Aborting: no font found\n");
+ GetGC(sink);
+
sink->ascii_sink.cursor_position = 0;
sink->ascii_sink.laststate = XawisOff;
sink->ascii_sink.cursor_x = sink->ascii_sink.cursor_y = 0;