]> git.pld-linux.org Git - packages/pinfo.git/commitdiff
- added truncation-workaround patch to workaround build failure on th-i686; release 2 master auto/th/pinfo-0.6.13-2
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 3 Oct 2021 06:33:03 +0000 (08:33 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 3 Oct 2021 06:33:03 +0000 (08:33 +0200)
pinfo-truncation-workaround.patch [new file with mode: 0644]
pinfo.spec

diff --git a/pinfo-truncation-workaround.patch b/pinfo-truncation-workaround.patch
new file mode 100644 (file)
index 0000000..551d846
--- /dev/null
@@ -0,0 +1,26 @@
+gcc's -Werror=stringop-truncation tries to be too smart, but actually it isn't.
+Take len just after initialization, before call to mkstemp() (which doesn't change string length);
+now gcc doesn't complain.
+
+--- pinfo-0.6.13/src/utils.c.orig      2019-02-16 21:23:32.000000000 +0100
++++ pinfo-0.6.13/src/utils.c   2021-10-03 07:45:00.428038370 +0200
+@@ -848,10 +848,10 @@ char *
+ make_tempfile()
+ {
+       char *filename;
+-      size_t len;
+       /* TODO: fix hardcoded /tmp */
+       char tmpfile_template[] = "/tmp/pinfo.XXXXXX";
++      size_t len = strlen(tmpfile_template)+1;
+       /* create a tmpfile */
+       int fd = mkstemp(tmpfile_template);
+@@ -864,7 +864,6 @@ make_tempfile()
+       }
+       /* allocate a new string and copy the filename there */
+-      len = strlen(tmpfile_template)+1;
+       filename = xmalloc(len+1); /* guarenteerd to be set to \0's */
+       strncpy(filename, tmpfile_template, len);
index f9dd1fdeace89154e1558bef16722db1bd24d017..606cf4fd9a8a362d6c256cd264d3f5adb779e205 100644 (file)
@@ -6,7 +6,7 @@ Summary(ru.UTF-8):      Программа просмотра info- и man-докум
 Summary(uk.UTF-8):     Програма перегляду info- та man-документів у стилі lynx
 Name:          pinfo
 Version:       0.6.13
 Summary(uk.UTF-8):     Програма перегляду info- та man-документів у стилі lynx
 Name:          pinfo
 Version:       0.6.13
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Applications/System
 #Source0Download: https://github.com/baszoetekouw/pinfo/releases
 License:       GPL v2
 Group:         Applications/System
 #Source0Download: https://github.com/baszoetekouw/pinfo/releases
@@ -21,6 +21,7 @@ Patch3:               %{name}-info.patch
 Patch4:                %{name}-gettext.patch
 Patch5:                %{name}-color.patch
 Patch6:                %{name}-no-common.patch
 Patch4:                %{name}-gettext.patch
 Patch5:                %{name}-color.patch
 Patch6:                %{name}-no-common.patch
+Patch7:                %{name}-truncation-workaround.patch
 URL:           https://github.com/baszoetekouw/pinfo
 BuildRequires: autoconf >= 2.57
 BuildRequires: automake
 URL:           https://github.com/baszoetekouw/pinfo
 BuildRequires: autoconf >= 2.57
 BuildRequires: automake
@@ -66,6 +67,7 @@ Pinfo - це програма перегляду info-файлів та man-ст
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %build
 CPPFLAGS="-I%{_includedir}/ncursesw"
 
 %build
 CPPFLAGS="-I%{_includedir}/ncursesw"
This page took 0.079532 seconds and 4 git commands to generate.