From ea4c49c58fb496c6d0b4c132c676e338b88700ab Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 28 Jul 2020 11:35:59 -0600 Subject: [PATCH] - Force C++14 as this code is not C++17 ready - Fix sprintf format issue - Fix ordered comparison of a pointer against zero issue --- esc-gcc11.patch | 26 ++++++++++++++++++++++++++ esc.spec | 10 +++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 esc-gcc11.patch diff --git a/esc-gcc11.patch b/esc-gcc11.patch new file mode 100644 index 0000000..b145c30 --- /dev/null +++ b/esc-gcc11.patch @@ -0,0 +1,26 @@ +diff --git a/esc/src/lib/coolkey/CoolKey_Message.cpp b/esc/src/lib/coolkey/CoolKey_Message.cpp +index 87ee309..7b80f70 100644 +--- a/esc/src/lib/coolkey/CoolKey_Message.cpp ++++ b/esc/src/lib/coolkey/CoolKey_Message.cpp +@@ -213,7 +213,7 @@ void eCKMessage::setBinValue(string &aKey,unsigned char*aValue,int *aSize) + if(!aKey.length()) + return; + +- if(aSize <=0 || !aValue) ++ if(aSize ==0 || !aValue) + return; + + string data = ""; +diff --git a/esc/src/lib/nss-http-client/request.cpp b/esc/src/lib/nss-http-client/request.cpp +index cabd94f..5428350 100644 +--- a/esc/src/lib/nss-http-client/request.cpp ++++ b/esc/src/lib/nss-http-client/request.cpp +@@ -192,7 +192,7 @@ PRBool PSHttpRequest::setBody(int size, const char* body) { + } + + _bodyLength = size; +- sprintf(_body,body); ++ sprintf(_body,"%s",body); + //_body = (char *)body; + + return PR_TRUE; diff --git a/esc.spec b/esc.spec index c382a61..259b7f4 100644 --- a/esc.spec +++ b/esc.spec @@ -1,6 +1,6 @@ Name: esc Version: 1.1.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Enterprise Security Client Smart Card Client License: GPL+ URL: http://directory.fedora.redhat.com/wiki/CoolKey @@ -58,6 +58,7 @@ Source0: http://pki.fedoraproject.org/pki/sources/%name/%{escname}.tar.bz2 Source1: http://pki.fedoraproject.org/pki/sources/%name/esc Source2: http://pki.fedoraproject.org/pki/sources/%name/esc.desktop Source3: http://pki.fedoraproject.org/pki/sources/%name/esc.png +Patch0: esc-gcc11.patch %description @@ -67,10 +68,12 @@ cryptographic smartcards. %prep %setup -q -c -n %{escname} +%patch0 -p1 #patch esc %build +export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" echo $RPM_BUILD_DIR @@ -132,6 +135,11 @@ cp %{escname}/esc/LICENSE $RPM_BUILD_ROOT/%{docdir} %{_datadir}/%{appdir}/esc.desktop %changelog +* Tue Jul 28 2020 Jeff Law - 1.1.2-7 +- Force C++14 as this code is not C++17 ready +- Fix sprintf format issue +- Fix ordered comparison of a pointer against zero issue + * Mon Jul 27 2020 Fedora Release Engineering - 1.1.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild