diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-03 20:45:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-03 20:45:20 +0000 |
commit | 8a5cf8f14fbb30db62fd5be65920227057506fdb (patch) | |
tree | 6f04a978fdfe9cd06a0d2375af1e353dfc6e0474 | |
parent | 9006e7df90a12bcee21ffbe7dfa3319b26f745ed (diff) | |
download | libmicrohttpd-8a5cf8f14fbb30db62fd5be65920227057506fdb.tar.gz libmicrohttpd-8a5cf8f14fbb30db62fd5be65920227057506fdb.zip |
fixing 1666
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/daemon/base64.c | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ | |||
1 | Thu Mar 3 21:42:47 CET 2011 | ||
2 | Fixing issue where Base64 decode fails when char is defined | ||
3 | as unsigned char (Mantis 1666). -CG/tmayer | ||
4 | |||
1 | Tue Mar 1 13:58:04 CET 2011 | 5 | Tue Mar 1 13:58:04 CET 2011 |
2 | Allow use of 'poll' in combination with the external select mode. | 6 | Allow use of 'poll' in combination with the external select mode. |
3 | Avoid using pthread signals (SIGALRM), use pipe instead. | 7 | Avoid using pthread signals (SIGALRM), use pipe instead. |
diff --git a/src/daemon/base64.c b/src/daemon/base64.c index efd00096..d15463bc 100644 --- a/src/daemon/base64.c +++ b/src/daemon/base64.c | |||
@@ -46,10 +46,10 @@ char* BASE64Decode(const char* src) { | |||
46 | char c = base64_digits[(unsigned char)*(src++)]; | 46 | char c = base64_digits[(unsigned char)*(src++)]; |
47 | char d = base64_digits[(unsigned char)*(src++)]; | 47 | char d = base64_digits[(unsigned char)*(src++)]; |
48 | *(dest++) = (a << 2) | ((b & 0x30) >> 4); | 48 | *(dest++) = (a << 2) | ((b & 0x30) >> 4); |
49 | if (c == -1) | 49 | if (c == (char)-1) |
50 | break; | 50 | break; |
51 | *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); | 51 | *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); |
52 | if (d == -1) | 52 | if (d == (char)-1) |
53 | break; | 53 | break; |
54 | *(dest++) = ((c & 0x03) << 6) | d; | 54 | *(dest++) = ((c & 0x03) << 6) | d; |
55 | } | 55 | } |