aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-31 11:54:26 -0500
committerDavid Robillard <d@drobilla.net>2019-01-05 17:12:38 +0100
commit9b80535334de1a3ca0bf40d2f1109202385148aa (patch)
tree34e5a1f011e1f10d1797b364ce760f92f795df9f
parente7f88b4e0e3a88ff79a956b67590cb2b0c4fd16b (diff)
downloadserd-9b80535334de1a3ca0bf40d2f1109202385148aa.tar.gz
serd-9b80535334de1a3ca0bf40d2f1109202385148aa.tar.bz2
serd-9b80535334de1a3ca0bf40d2f1109202385148aa.zip
Fix implicit signed conversions in base64 implementation
-rw-r--r--src/base64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base64.c b/src/base64.c
index 7bc4a127..4171ed22 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -38,7 +38,7 @@ static const uint8_t b64_map[] =
for decoding, shifted up by 47 to be in the range of printable ASCII.
A '$' is a placeholder for characters not in the base64 alphabet.
*/
-static const char b64_unmap[] =
+static const uint8_t b64_unmap[] =
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$m$$$ncdefghijkl$$$$$$"
"$/0123456789:;<=>?@ABCDEFGH$$$$$$IJKLMNOPQRSTUVWXYZ[\\]^_`ab$$$$"
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
@@ -113,7 +113,7 @@ serd_base64_decode(const char* str, size_t len, size_t* size)
uint8_t in[] = "====";
size_t n_in = 0;
for (; i < len && n_in < 4; ++n_in) {
- for (; i < len && !is_base64(ustr[i]); ++i) {} // Skip junk
+ for (; i < len && !is_base64(str[i]); ++i) {} // Skip junk
in[n_in] = ustr[i++];
}
if (n_in > 1) {