From 63b5996609c7aae1ff50e42298dacca10541ef42 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Jan 18 2024 07:38:48 +0000 Subject: Backport upstream patches for upstream 2 issues Fix exporting only active layers Sanitize a call to realloc (redhat #2252679) --- diff --git a/Fix-exporting-only-active-layers-ticket-163.patch b/Fix-exporting-only-active-layers-ticket-163.patch new file mode 100644 index 0000000..dabc1c1 --- /dev/null +++ b/Fix-exporting-only-active-layers-ticket-163.patch @@ -0,0 +1,29 @@ +From a4a2f3f3aa29ec7fc84f9d782306b37bbe75025c Mon Sep 17 00:00:00 2001 +From: Thomas Loimer +Date: Sun, 31 Dec 2023 22:51:29 +0100 +Subject: [PATCH] Fix exporting only active layers, ticket #163 + +--- + src/u_print.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/u_print.c b/src/u_print.c +index c24c096..57921b3 100644 +--- a/src/u_print.c ++++ b/src/u_print.c +@@ -861,10 +861,10 @@ build_layer_list(char *layers) + } + if (len < notlen && firstyes != -1) { + /* use list of layers TO print */ +- sprintf(layers," -D +%s ",list); ++ sprintf(layers, "+%s", list); + } else if (firstno != -1){ + /* use list of layers to NOT print */ +- sprintf(layers," -D -%s ",notlist); ++ sprintf(layers, "-%s", notlist); + } + } + +-- +2.39.2 + diff --git a/Sanitize-a-call-to-realloc-ticket-165.patch b/Sanitize-a-call-to-realloc-ticket-165.patch new file mode 100644 index 0000000..94b8246 --- /dev/null +++ b/Sanitize-a-call-to-realloc-ticket-165.patch @@ -0,0 +1,44 @@ +From 68403622a6f6c7d74f73e38989cfc0ed86fb83fc Mon Sep 17 00:00:00 2001 +From: Thomas Loimer +Date: Sun, 31 Dec 2023 15:18:45 +0100 +Subject: [PATCH] Sanitize a call to realloc(), ticket #165 + +--- + src/u_print.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/u_print.c b/src/u_print.c +index 2ed385f..c24c096 100644 +--- a/src/u_print.c ++++ b/src/u_print.c +@@ -130,7 +130,7 @@ start_argumentlist(char *arg[restrict], char argbuf[restrict][ARGBUF_SIZE], + arg[0] = fig2dev_cmd; + arg[1] = "-L"; + *a = 2; /* arg[2] will be the output language */ +- if (appres.magnification < 99.99 | appres.magnification > 100.01) { ++ if (appres.magnification < 99.99 || appres.magnification > 100.01) { + int n; + arg[++*a] = "-m"; + n = snprintf(argbuf[++*b], ARGBUF_SIZE, +@@ -531,6 +531,7 @@ print_export(char *file, int xoff, int yoff, char *backgrnd, char *transparent, + } else if (cur_exp_lang == LANG_PSTEX || + cur_exp_lang == LANG_PDFTEX) { + size_t len = strlen(outfile); ++ char *s; + + /* Options were already set above + - output the first file */ +@@ -544,8 +545,9 @@ print_export(char *file, int xoff, int yoff, char *backgrnd, char *transparent, + goto free_outfile; + } + memcpy(tmp_name, outfile, len + 1); +- if (!realloc(outfile, len + 3)) { ++ if (!(outfile = realloc(s = outfile, len + 3))) { + ret = 1; ++ outfile = s; /* for free(outfile) below */ + goto free_tmp_name; + } + strcpy(outfile + len, "_t"); +-- +2.39.2 + diff --git a/xfig.spec b/xfig.spec index 8e29f6d..35b688f 100644 --- a/xfig.spec +++ b/xfig.spec @@ -3,13 +3,20 @@ Summary: An X Window System tool for drawing basic vector graphics Name: xfig Version: 3.2.9 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://en.wikipedia.org/wiki/Xfig Source0: http://downloads.sourceforge.net/mcj/xfig-%{version}.tar.xz Source1: xfig-icons.tar.gz Source2: xfig.desktop Source3: xfig.appdata.xml +# https://sourceforge.net/p/mcj/tickets/165/ +# https://bugzilla.redhat.com/show_bug.cgi?id=2252679 +# https://sourceforge.net/p/mcj/xfig/ci/68403622a6f6c7d74f73e38989cfc0ed86fb83fc/ +Patch0: Sanitize-a-call-to-realloc-ticket-165.patch +# https://sourceforge.net/p/mcj/tickets/163/ +# https://sourceforge.net/p/mcj/xfig/ci/a4a2f3f3aa29ec7fc84f9d782306b37bbe75025c/ +Patch1: Fix-exporting-only-active-layers-ticket-163.patch #Patch0: xfig-3.2.5a-default-apps.patch #Patch1: xfig-3.2.5-urwfonts.patch @@ -108,7 +115,12 @@ appstream-util validate-relax --nonet \ %changelog -* Sat Aug 26 2023 Ranjan Maitra - 3.2.9 +* Thu Jan 18 2024 Mamoru TASAKA - 3.2.9-2 +- Backport upstream patches for upstream 2 issues + - Fix exporting only active layers + - Sanitize a call to realloc (redhat #2252679) + +* Sat Aug 26 2023 Ranjan Maitra - 3.2.9-1 - New upstream release 3.2.9 * Sat Jan 21 2023 Fedora Release Engineering - 3.2.8b-4