From 73b56e01dd4a5d76e7f1443c56b99f65402b7794e2b70240602540be180a4eeb Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Thu, 21 Jun 2018 09:43:01 +0000 Subject: [PATCH] Accepting request 618271 from home:michalsrb:branches:bnc1098411:X11:XOrg - U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch * Fix crash when required font is not installed. (bsc#1098411) OBS-URL: https://build.opensuse.org/request/show/618271 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libXaw?expand=0&rev=18 --- ...ereference-in-XawAsciiSinkInitialize.patch | 47 +++++++++++++++++++ libXaw.changes | 6 +++ libXaw.spec | 4 +- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch diff --git a/U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch b/U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch new file mode 100644 index 0000000..b8e6902 --- /dev/null +++ b/U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch @@ -0,0 +1,47 @@ +Git-commit: ba7321b6a52726cdb9964b82c5111518dc1f437d +Author: Tobias Stoeckmann +Subject: NULL pointer dereference in XawAsciiSinkInitialize +References: bsc#1098411 +Patch-Mainline: Upstream +Signed-off-by: Michal Srb + +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 +Reviewed-by: Peter Hutterer +Signed-off-by: Peter Hutterer +--- + src/AsciiSink.c | 4 ++-- + 1 file 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; +-- +2.13.6 + diff --git a/libXaw.changes b/libXaw.changes index 9fc0792..ca2c0eb 100644 --- a/libXaw.changes +++ b/libXaw.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 21 08:46:58 UTC 2018 - msrb@suse.com + +- U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch + * Fix crash when required font is not installed. (bsc#1098411) + ------------------------------------------------------------------- Mon May 4 14:11:30 UTC 2015 - sndirsch@suse.com diff --git a/libXaw.spec b/libXaw.spec index c0ef625..56c0954 100644 --- a/libXaw.spec +++ b/libXaw.spec @@ -1,7 +1,7 @@ # # spec file for package libXaw # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,7 @@ Url: http://xorg.freedesktop.org/ #Git-Web: http://cgit.freedesktop.org/xorg/lib/libXaw/ Source: http://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.bz2 Source1: baselibs.conf +Patch0: U_NULL-pointer-dereference-in-XawAsciiSinkInitialize.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build #git#BuildRequires: autoconf >= 2.60, automake, libtool BuildRequires: pkgconfig @@ -102,6 +103,7 @@ in libXaw6/libXaw7/libXaw8. %prep %setup -q +%patch0 -p1 %build %configure --docdir=%_docdir/%name --disable-static