aboutsummaryrefslogtreecommitdiffstats
path: root/main/qca/fix-base64-decoding-on-ARM.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/qca/fix-base64-decoding-on-ARM.patch')
-rw-r--r--main/qca/fix-base64-decoding-on-ARM.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/qca/fix-base64-decoding-on-ARM.patch b/main/qca/fix-base64-decoding-on-ARM.patch
new file mode 100644
index 0000000000..06deb38258
--- /dev/null
+++ b/main/qca/fix-base64-decoding-on-ARM.patch
@@ -0,0 +1,36 @@
+From: Rolf Eike Beer <eb@emlix.com>
+Date: Mon, 27 Jun 2016 10:55:51 +0000
+Subject: fix base64 decoding on ARM
+X-Git-Url: http://quickgit.kde.org/?p=qca.git&a=commitdiff&h=601fd3a05141c614ae48a3ddac44194d669eaae1
+---
+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
+---
+
+
+--- a/src/qca_textfilter.cpp
++++ b/src/qca_textfilter.cpp
+@@ -293,7 +293,7 @@
+ // 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,
+