xmlrpc-c/xmlrpc-c-int-to-char-conversion.patch

35 lines
1.6 KiB
Diff
Raw Normal View History

--- xmlrpc-c-1.32.5/src/cpp/base64.cpp~ 2010-05-21 00:52:29.000000000 +0200
+++ xmlrpc-c-1.32.5/src/cpp/base64.cpp 2016-02-16 08:37:43.874552656 +0100
@@ -15,14 +15,14 @@
namespace {
char const table_a2b_base64[] = {
- -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,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, /* Note PAD->0 */
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+ 64,64,64,64, 64,64,64,64, 64,64,64,64, 64,64,64,64,
+ 64,64,64,64, 64,64,64,64, 64,64,64,64, 64,64,64,64,
+ 64,64,64,64, 64,64,64,64, 64,64,64,62, 64,64,64,63,
+ 52,53,54,55, 56,57,58,59, 60,61,64,64, 64, 0,64,64, /* Note PAD->0 */
+ 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,64, 64,64,64,64,
+ 64,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,64, 64,64,64,64
};
char const base64Pad('=');
@@ -210,7 +210,7 @@
buffer.discardResidue();
} else {
unsigned int const tableIndex(thisChar);
- if (table_a2b_base64[tableIndex] == -1)
+ if (table_a2b_base64[tableIndex] == 64)
throwf("Contains non-base64 character "
"with ASCII code 0x%02x", thisChar);