From 9c751c534ecff893b844e6eb74942ef996064414 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 21 Jan 2022 11:06:05 +0100 Subject: [PATCH] Fix crash in vncviewer --- ...fix-typo-in-mirror-monitor-detection.patch | 34 +++++++++++++++++++ tigervnc.spec | 7 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tigervnc-fix-typo-in-mirror-monitor-detection.patch diff --git a/tigervnc-fix-typo-in-mirror-monitor-detection.patch b/tigervnc-fix-typo-in-mirror-monitor-detection.patch new file mode 100644 index 0000000..9076432 --- /dev/null +++ b/tigervnc-fix-typo-in-mirror-monitor-detection.patch @@ -0,0 +1,34 @@ +From 2daf4126882f82b6e392dfbae87205dbdc559c3d Mon Sep 17 00:00:00 2001 +From: Pierre Ossman +Date: Thu, 23 Dec 2021 15:58:00 +0100 +Subject: [PATCH] Fix typo in mirror monitor detection + +Bug introduced in fb561eb but still somehow passed manual testing. +Resulted in some stray reads off the end of the stack, which were +hopefully harmless. +--- + vncviewer/MonitorIndicesParameter.cxx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/vncviewer/MonitorIndicesParameter.cxx b/vncviewer/MonitorIndicesParameter.cxx +index 5130831cb..4ac74dd1a 100644 +--- a/vncviewer/MonitorIndicesParameter.cxx ++++ b/vncviewer/MonitorIndicesParameter.cxx +@@ -211,13 +211,13 @@ std::vector MonitorIndicesParameter::fetchMoni + // Only keep a single entry for mirrored screens + match = false; + for (int j = 0; j < ((int) monitors.size()); j++) { +- if (monitors[i].x != monitor.x) ++ if (monitors[j].x != monitor.x) + continue; +- if (monitors[i].y != monitor.y) ++ if (monitors[j].y != monitor.y) + continue; +- if (monitors[i].w != monitor.w) ++ if (monitors[j].w != monitor.w) + continue; +- if (monitors[i].h != monitor.h) ++ if (monitors[j].h != monitor.h) + continue; + + match = true; diff --git a/tigervnc.spec b/tigervnc.spec index 35e6b56..0829c5a 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -4,7 +4,7 @@ Name: tigervnc Version: 1.12.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A TigerVNC remote display system %global _hardened_build 1 @@ -25,6 +25,7 @@ Source5: vncserver # Upstream patches Patch50: tigervnc-selinux-restore-context-in-case-of-different-policies.patch +Patch51: tigervnc-fix-typo-in-mirror-monitor-detection.patch # This is tigervnc-%%{version}/unix/xserver116.patch rebased on the latest xorg Patch100: tigervnc-xserver120.patch @@ -142,6 +143,7 @@ runs properly under an environment with SELinux enabled. %setup -q %patch50 -p1 -b .selinux-restore-context-in-case-of-different-policies +%patch51 -p1 -b .fix-typo-in-mirror-monitor-detection cp -r /usr/share/xorg-x11-server-source/* unix/xserver pushd unix/xserver @@ -323,6 +325,9 @@ fi %ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename} %changelog +* Fri Jan 21 2022 Jan Grulich - 1.12.0-4 +- Fix crash in vncviewer + * Fri Jan 14 2022 Jan Grulich - 1.12.0-3 - Remove unavailable option from vncserver script