diff --git a/recipes-kde/other/qca/files/0002-fix-base64-decoding-on-ARM.patch b/recipes-kde/other/qca/files/0002-fix-base64-decoding-on-ARM.patch new file mode 100644 index 00000000..d8aedd77 --- /dev/null +++ b/recipes-kde/other/qca/files/0002-fix-base64-decoding-on-ARM.patch @@ -0,0 +1,40 @@ +From 601fd3a05141c614ae48a3ddac44194d669eaae1 Mon Sep 17 00:00:00 2001 +From: Rolf Eike Beer +Date: Mon, 27 Jun 2016 12:55:51 +0200 +Subject: [PATCH] fix base64 decoding on ARM + +This code was broken on ARM and other architectures where "char" is unsigned by +default. + +First, it breaks with newer compilers with errors like: + + .../src/qca_textfilter.cpp:314:2: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing] + +Second, if the compiler would just allow this conversion then the unsigned char +would hold 255, which would not be sign extended when cast to an int later, so +all the checks "< 0" will never trigger, and so invalid input characters cannot +be detected. + +REVIEW:128295 +BUG:364495 +Upstream-Status: Applied +--- + src/qca_textfilter.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qca_textfilter.cpp b/src/qca_textfilter.cpp +index 9889a24..3baf511 100644 +--- a/src/qca_textfilter.cpp ++++ b/src/qca_textfilter.cpp +@@ -293,7 +293,7 @@ static QByteArray b64decode(const QByteArray &s, bool *ok) + // 64 specifies eof + // everything else specifies data + +- static char tbl[] = ++ static signed char tbl[] = + { + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +-- +2.5.5 + diff --git a/recipes-kde/other/qca/qca_2.1.1.bb b/recipes-kde/other/qca/qca_2.1.1.bb index 75043cf8..a4684bdd 100644 --- a/recipes-kde/other/qca/qca_2.1.1.bb +++ b/recipes-kde/other/qca/qca_2.1.1.bb @@ -17,7 +17,10 @@ DEPENDS += " \ SRC_URI[md5sum] = "657cc701316600199199a6b6cb2c73c9" SRC_URI[sha256sum] = "95de3e7910b5f9ec7084169989c9d98bfb527e6a4865fe17269c3b24308be983" -SRC_URI += "file://0001-use-pkg-config-to-find-libgcrypt.patch" +SRC_URI += " \ + file://0001-use-pkg-config-to-find-libgcrypt.patch \ + file://0002-fix-base64-decoding-on-ARM.patch \ +" EXTRA_OECMAKE += "-DQCA_FEATURE_INSTALL_DIR=${libdir}${QT_DIR_NAME}/mkspecs/features"