From 5db0de7f38f59cf8f1dcea8b06b4c2303ad9e07c Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Tue, 14 May 2019 13:36:19 +0200 Subject: [PATCH] Protect against NULL variable reaching strcmp() Resolves: #1692083 --- ...otect-against-NULL-var-reaching-strc.patch | 30 +++++++++++++++++++ evince.spec | 11 +++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 0001-sidebar-links-protect-against-NULL-var-reaching-strc.patch diff --git a/0001-sidebar-links-protect-against-NULL-var-reaching-strc.patch b/0001-sidebar-links-protect-against-NULL-var-reaching-strc.patch new file mode 100644 index 0000000..34243b8 --- /dev/null +++ b/0001-sidebar-links-protect-against-NULL-var-reaching-strc.patch @@ -0,0 +1,30 @@ +From ed0241a5307e83484e25c01a8027504ea4dc35f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= +Date: Thu, 21 Mar 2019 22:25:00 -0400 +Subject: [PATCH] sidebar links: protect against NULL var reaching strcmp() + +Protect against a valid case of index_expand being NULL, +by adding a NULL check prior to checking for empty string +with strcmp(). + +Fixes #1113 +--- + shell/ev-sidebar-links.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/shell/ev-sidebar-links.c b/shell/ev-sidebar-links.c +index 8955d19c..29d3997e 100644 +--- a/shell/ev-sidebar-links.c ++++ b/shell/ev-sidebar-links.c +@@ -518,7 +518,7 @@ row_collapsed_cb (GtkTreeView *tree_view, + if (ev_metadata_get_string (metadata, "index-collapse", &index_collapse)) { + /* If collapsed row is not in 'index_collapse' we add it. */ + if (g_strstr_len (index_collapse, -1, path_token) == NULL) { +- if (!strcmp (index_expand, "")) ++ if (!index_expand || !strcmp (index_expand, "")) + new_index = g_strconcat (index_collapse, path_token, NULL); + else + new_index = g_strconcat (index_collapse, path_token + 1, NULL); +-- +2.20.1 + diff --git a/evince.spec b/evince.spec index 725cf73..e98aaa0 100644 --- a/evince.spec +++ b/evince.spec @@ -6,7 +6,7 @@ Name: evince Version: 3.32.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Document viewer License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse @@ -14,7 +14,10 @@ URL: https://wiki.gnome.org/Apps/Evince Source0: https://download.gnome.org/sources/%{name}/3.32/%{name}-%{version}.tar.xz # https://bugzilla.gnome.org/show_bug.cgi?id=766749 -Patch3: 0001-Resolves-deb-762530-rhbz-1061177-add-man-pages.patch +Patch0: 0001-Resolves-deb-762530-rhbz-1061177-add-man-pages.patch + +# https://bugzilla.gnome.org/show_bug.cgi?id=1692083 +Patch1: 0001-sidebar-links-protect-against-NULL-var-reaching-strc.patch BuildRequires: gcc-c++ BuildRequires: gcc @@ -259,6 +262,10 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p %endif %changelog +* Tue May 14 2019 Marek Kasik - 3.32.0-4 +- Protect against NULL variable reaching strcmp() +- Resolves: #1692083 + * Wed Apr 17 2019 Kalev Lember - 3.32.0-3 - Rebuild with Meson fix for #1699099