From 2dbff98ba3f05fa8087d5997e696bc19015af1fa Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Jan 11 2023 16:36:13 +0000 Subject: apply upstream fix for issue where tslib could segfault when running ts_conf --- diff --git a/tslib-1.22-check-pointer-before-calling-sprintf.patch b/tslib-1.22-check-pointer-before-calling-sprintf.patch new file mode 100644 index 0000000..4a77d06 --- /dev/null +++ b/tslib-1.22-check-pointer-before-calling-sprintf.patch @@ -0,0 +1,21 @@ +diff -up tslib-1.22/src/ts_config.c.check-pointer-before-calling-sprintf tslib-1.22/src/ts_config.c +--- tslib-1.22/src/ts_config.c.check-pointer-before-calling-sprintf 2023-01-11 11:25:58.052907042 -0500 ++++ tslib-1.22/src/ts_config.c 2023-01-11 11:26:50.806468613 -0500 +@@ -131,7 +131,7 @@ static int __ts_config(struct tsdev *ts, + module_name, p); + #endif + sprintf(conffile_modules[line], "%s", module_name); +- if (conffile_params) ++ if (conffile_params && p) + sprintf(conffile_params[line], "%s", p); + } + } else if (strcasecmp(tok, "module_raw") == 0) { +@@ -149,7 +149,7 @@ static int __ts_config(struct tsdev *ts, + module_name, p); + #endif + sprintf(conffile_modules[line], "%s", module_name); +- if (conffile_params) ++ if (conffile_params && p) + sprintf(conffile_params[line], "%s", p); + + if (raw) diff --git a/tslib.spec b/tslib.spec index 1eb84c8..2a69757 100644 --- a/tslib.spec +++ b/tslib.spec @@ -1,11 +1,13 @@ Name: tslib Version: 1.22 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Touchscreen Access Library License: LGPLv2 URL: https://github.com/kergoth/tslib Source0: https://github.com/kergoth/tslib/releases/download/%{version}/tslib-%{version}.tar.bz2 -BuildRequires: make +# https://github.com/libts/tslib/commit/bec90dfaca8273b9c53268c6c0af1576695bc72c +Patch0: tslib-1.22-check-pointer-before-calling-sprintf.patch +BuildRequires: make BuildRequires: libtool, autoconf, automake BuildRequires: SDL2-devel @@ -32,6 +34,7 @@ developing applications that use %{name}. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 -b .check-pointer-before-calling-sprintf ./autogen.sh %build @@ -62,6 +65,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %{_libdir}/pkgconfig/tslib.pc %changelog +* Wed Jan 11 2023 Tom Callaway - 1.22-7 +- apply upstream fix for issue where tslib could segfault when running ts_conf + * Sat Jul 23 2022 Fedora Release Engineering - 1.22-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild