[packages/hylafax] - added faxRecvInfo patch (fix bug detected by gcc 7 + many more found in this code)

qboosh qboosh at pld-linux.org
Mon Apr 16 19:10:25 CEST 2018


commit d8ff0ff0ce5a2fab8950c88773b64149ee20015e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Apr 16 19:10:37 2018 +0200

    - added faxRecvInfo patch (fix bug detected by gcc 7 + many more found in this code)

 hylafax-FaxRecvInfo.patch | 36 ++++++++++++++++++++++++++++++++++++
 hylafax.spec              |  4 +++-
 2 files changed, 39 insertions(+), 1 deletion(-)
---
diff --git a/hylafax.spec b/hylafax.spec
index 77eedd5..f0b9a7b 100644
--- a/hylafax.spec
+++ b/hylafax.spec
@@ -24,6 +24,7 @@ Patch1:		%{name}-topmargin.patch
 Patch2:		%{name}-pic.patch
 Patch3:		%{name}-awk.patch
 Patch4:		%{name}-format.patch
+Patch5:		%{name}-FaxRecvInfo.patch
 URL:		http://www.hylafax.org/
 BuildRequires:	jbigkit-devel
 BuildRequires:	libstdc++-devel
@@ -148,6 +149,7 @@ Ten pakiet zawiera bibliotekę współdzieloną HylaFAX.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %ifarch sparc64
 sed -i -e 's/-fpic/-fPIC/g' configure
@@ -157,7 +159,7 @@ sed -i -e 's/-fpic/-fPIC/g' configure
 # set dummy GCOPTS,GCXXOPTS to avoid adding "-g"
 # the configure is too stupid to keep spaces in CC/CXX, so strip ccache if any
 CC="%{__cc}"
-CCXX="%{__cxx}"
+CXX="%{__cxx}"
 CC=${CC#ccache } \
 CXX=${CXX#ccache } \
 GCOPTS=" " \
diff --git a/hylafax-FaxRecvInfo.patch b/hylafax-FaxRecvInfo.patch
new file mode 100644
index 0000000..0a5449c
--- /dev/null
+++ b/hylafax-FaxRecvInfo.patch
@@ -0,0 +1,36 @@
+--- hylafax-6.0.6/libhylafax/FaxRecvInfo.c++.orig	2012-06-06 02:58:38.000000000 +0200
++++ hylafax-6.0.6/libhylafax/FaxRecvInfo.c++	2018-04-16 19:01:56.584228628 +0200
+@@ -96,26 +96,27 @@
+     cp = strchr(cp+1, '"');
+     if (cp == NULL || cp[1] != ',' || cp[2] != '"')
+ 	return (false);
+-    passwd = cp+1;
++    passwd = cp+3;
+     passwd.resize(sender.next(0,'"'));
+-    cp = strchr(cp+1, '"');
++    cp = strchr(cp+3, '"');
+     if (cp == NULL || cp[1] != ',' || cp[2] != '"')
+ 	return (false);
+     subaddr = cp+3;			// +1 for "/+1 for ,/+1 for "
+     subaddr.resize(subaddr.next(0,'"'));
+-    cp = strchr(cp+1, '"');
++    cp = strchr(cp+3, '"');
+     if (cp == NULL || cp[1] != ',' || cp[2] != '"')
+ 	return (false);
+     reason = cp+3;			// +1 for "/+1 for ,/+1 for "
+     reason.resize(reason.next(0,'"'));
+-    cp = strchr(cp+1, '"');
++    cp = strchr(cp+3, '"');
+     if (cp == NULL || cp[1] != ',' || cp[2] != '"')
+ 	return (false);
+     u_int i = 0;
+-    while (cp+2 != '\0') {
++    while (cp[1] == ',' && cp[2] == '"') {
+ 	callid[i] = cp+3;		// +1 for "/+1 for ,/+1 for "
+-	if (*cp == '\"') break;
+ 	callid[i].resize(callid[i].next(0,'"'));
++	cp = strchr(cp+3, '"');
++	if (cp == NULL) break;
+ 	i++;
+     }
+     return (true);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/hylafax.git/commitdiff/d8ff0ff0ce5a2fab8950c88773b64149ee20015e



More information about the pld-cvs-commit mailing list