public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/xiphos] f43: Fix CVE-2026-79079
@ 2026-10-04 15:57 Aaron Rainbolt
  0 siblings, 0 replies; only message in thread
From: Aaron Rainbolt @ 2026-10-04 15:57 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/xiphos
Branch : f43
Commit : 3774dfd5e2058b1422d057c0297ff7a4fd095e1c
Author : Aaron Rainbolt <arraybolt3@fedoraproject.org>
Date   : 2026-09-30T19:52:48-04:00
Stats  : +157/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/xiphos/c/3774dfd5e2058b1422d057c0297ff7a4fd095e1c?branch=f43

Log:
Fix CVE-2026-79079

---
diff --git a/fix-CVE-2026-79079.patch b/fix-CVE-2026-79079.patch
new file mode 100644
index 0000000..b0b9b52
--- /dev/null
+++ b/fix-CVE-2026-79079.patch
@@ -0,0 +1,155 @@
+diff -ru a/src/gtk/menu_popup.c b/src/gtk/menu_popup.c
+--- a/src/gtk/menu_popup.c	2026-09-30 19:26:08.736197280 -0400
++++ b/src/gtk/menu_popup.c	2026-09-30 19:30:21.030752426 -0400
+@@ -1331,7 +1331,6 @@
+ 	const char *conf_old;
+ 	char *conf_new;
+ 	char *sworddir, *modsdir;
+-	FILE *result;
+ 
+ 	// get a new name for the module.
+ 	info = gui_new_dialog();
+@@ -1392,28 +1391,74 @@
+ 		goto out2;
+ 	}
+ 	// manufacture new .conf from old.
+-	g_string_printf(workstr,
+-			"( cd \"%s\" && sed -e '/^\\[/s|^.*$|[%s]|' -e '/^DataPath=/s|rawfiles/.*$|rawfiles/%s/|' < \"%s\" > \"%s.conf\" ) 2>&1",
+-			modsdir, info->text1, conf_new, conf_old,
+-			conf_new);
+-	if ((result = popen(workstr->str, "r")) == NULL) {
+-		g_string_printf(workstr,
++	gchar *conf_path_old = g_strdup_printf("%s/%s", modsdir, conf_old);
++	gchar *conf_path_new = g_strdup_printf("%s/%s.conf", modsdir, conf_new);
++	gchar *sed_old_sec = g_strdup_printf("[%s]", info->text1);
++	gchar *sed_old_path = g_strdup_printf("rawfiles/%s/", conf_new);
++	gchar *sed_expr = g_strdup_printf(
++			"/^\\[/s|^.*$|%s|;/^DataPath=/s|rawfiles/.*$|%s|",
++			sed_old_sec, sed_old_path);
++	gchar *argv[] = {
++		(gchar *)"sed", (gchar *)"-e", sed_expr, conf_path_old, NULL
++	};
++	GError *spawn_error = NULL;
++	gint exit_status = 0;
++	gchar *spawn_stdout = NULL;
++	gchar *spawn_stderr = NULL;
++	gboolean spawn_ok = g_spawn_sync(modsdir, argv, NULL,
++					 G_SPAWN_SEARCH_PATH,
++					 NULL, NULL, &spawn_stdout, &spawn_stderr, &exit_status, &spawn_error);
++	if (!spawn_ok) {
++		gchar *msg = g_strdup_printf(
+ 				_("Failed to create new configuration:\n%s"),
+-				strerror(errno));
+-		gui_generic_warning_modal(workstr->str);
++				spawn_error ? spawn_error->message : "unknown error");
++		gui_generic_warning_modal(msg);
++		g_free(msg);
++		if (spawn_error) g_error_free(spawn_error);
++		g_free(conf_path_old);
++		g_free(conf_path_new);
++		g_free(sed_old_sec);
++		g_free(sed_old_path);
++		g_free(sed_expr);
++		g_free(spawn_stdout);
++		g_free(spawn_stderr);
++		goto out2;
++	}
++	if (exit_status != 0) {
++		gchar *msg = g_strdup_printf(
++				_("Configuration build error:\n\n%s"),
++				spawn_stderr ? spawn_stderr : "(no error output)");
++		gui_generic_warning_modal(msg);
++		g_free(msg);
++		g_free(conf_path_old);
++		g_free(conf_path_new);
++		g_free(sed_old_sec);
++		g_free(sed_old_path);
++		g_free(sed_expr);
++		g_free(spawn_stdout);
++		g_free(spawn_stderr);
++		goto out2;
++	}
++	// Write sed output to the new .conf file.
++	if (!g_file_set_contents(conf_path_new, spawn_stdout ? spawn_stdout : "",
++				 spawn_stdout ? strlen(spawn_stdout) : 0, NULL)) {
++		gui_generic_warning_modal("Failed to write new configuration file.");
++		g_free(conf_path_old);
++		g_free(conf_path_new);
++		g_free(sed_old_sec);
++		g_free(sed_old_path);
++		g_free(sed_expr);
++		g_free(spawn_stdout);
++		g_free(spawn_stderr);
+ 		goto out2;
+-	} else {
+-		gchar output[258];
+-		if (fgets(output, 256, result) != NULL) {
+-			g_string_truncate(workstr, 0);
+-			g_string_append(workstr,
+-					_("Configuration build error:\n\n"));
+-			g_string_append(workstr, output);
+-			gui_generic_warning_modal(workstr->str);
+-			goto out2; // necessary?  advisable?
+-		}
+-		pclose(result);
+ 	}
++	g_free(conf_path_old);
++	g_free(conf_path_new);
++	g_free(sed_old_sec);
++	g_free(sed_old_path);
++	g_free(sed_expr);
++	g_free(spawn_stdout);
++	g_free(spawn_stderr);
+ 
+ 	// unlink old conf.
+ 	g_string_printf(workstr, "%s/%s", modsdir, conf_old);
+diff -ru a/src/main/url.cc b/src/main/url.cc
+--- a/src/main/url.cc	2026-09-30 19:26:08.738141893 -0400
++++ b/src/main/url.cc	2026-09-30 19:31:29.130558441 -0400
+@@ -172,8 +172,6 @@
+ 			gui_generic_warning((char *)"Could not display that image");
+ 		}
+ #else
+-		FILE *result;
+-		GString *cmd = g_string_new(NULL);
+ 		int i;
+ 
+ 		for (i = 0; display_progs[i]; i++) {
+@@ -186,26 +184,18 @@
+ 		}
+ 
+ 		XI_print(("file = %s\n", filename));
+-		g_string_printf(cmd, "%s \"%s\" < /dev/null > /dev/null 2>&1 &",
+-				display_progs[i], filename);
+-
+-		if ((result = popen(cmd->str, "r")) == NULL) {
+-			g_string_printf(cmd,
+-					_("Xiphos could not execute %s"),
+-					display_progs[i]);
+-			gui_generic_warning(cmd->str);
+-		} else {
+-			gchar output[258];
+-			if (fgets(output, 256, result) != NULL) {
+-				g_string_truncate(cmd, 0);
+-				g_string_append(cmd,
+-						_("Viewer error:\n"));
+-				g_string_append(cmd, output);
+-				gui_generic_warning(cmd->str);
+-			}
+-			pclose(result);
++		gchar *argv[] = {(gchar *)display_progs[i], (gchar *)filename, NULL};
++		GError *error = NULL;
++		if (!g_spawn_async(NULL, argv, NULL,
++				   (GSpawnFlags)(G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL),
++				   NULL, NULL, NULL, &error)) {
++			gchar *msg = g_strdup_printf(
++					_("Xiphos could not execute %s: %s"),
++					display_progs[i], error->message);
++			gui_generic_warning(msg);
++			g_free(msg);
++			g_error_free(error);
+ 		}
+-		g_string_free(cmd, TRUE);
+ #endif
+ 	} else {
+ 		gui_set_statusbar(filename);

diff --git a/xiphos.spec b/xiphos.spec
index f0d15cb..4832299 100644
--- a/xiphos.spec
+++ b/xiphos.spec
@@ -8,6 +8,7 @@ Summary:        Bible study and research tool
 License:        GPL-2.0-or-later
 URL:            http://xiphos.org/
 Source0:        https://github.com/crosswire/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
+Patch0:         fix-CVE-2026-79079.patch
 BuildRequires:  biblesync-devel >= 2.0.1-3
 BuildRequires:  cmake
 BuildRequires:  desktop-file-utils
@@ -46,6 +47,7 @@ Project and elsewhere.
 %prep
 %setup -q
 rm -rf src/biblesync
+%patch -P0 -p1
 
 %build
 export CFLAGS="$CFLAGS -fPIC"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-04 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04 15:57 [rpms/xiphos] f43: Fix CVE-2026-79079 Aaron Rainbolt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox