202,6 → 202,29 |
|
--- a/src/dkimverify.cpp |
+++ b/src/dkimverify.cpp |
@@ -210,7 +210,7 @@ void DecodeQuotedPrintable(char *ptr) |
//////////////////////////////////////////////////////////////////////////////// |
unsigned DecodeBase64(char *ptr) |
{ |
- static const unsigned char base64_table[256] = { |
+ static const signed char base64_table[256] = { |
-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,-1,-1,-1, |
-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, |
@@ -227,10 +227,10 @@ unsigned DecodeBase64(char *ptr) |
|
while (*s != '\0') |
{ |
- unsigned char value = base64_table[*s++]; |
- if ( (signed char)value >= 0 ) |
+ signed char value = base64_table[*s++]; |
+ if ( value >= 0 ) |
{ |
- b64accum = (b64accum << 6) | value; |
+ b64accum = (b64accum << 6) | (unsigned char)value; |
b64shift += 6; |
if (b64shift >= 8) |
{ |
@@ -442,7 +442,7 @@ int CDKIMVerify::GetResults(void) |
{ |
ProcessFinal(); |