aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-31 11:54:26 -0500
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commitbda9843d122d49e3a438709a57ffa6391d756dd1 (patch)
tree0b2fc16d3872351501228084efc6e93f10eb9945
parent56ce0b02736a455abfc3ea7cb8671e9068c2c4bc (diff)
downloadserd-bda9843d122d49e3a438709a57ffa6391d756dd1.tar.gz
serd-bda9843d122d49e3a438709a57ffa6391d756dd1.tar.bz2
serd-bda9843d122d49e3a438709a57ffa6391d756dd1.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 e557fdf8..ff1184b8 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$$$$"
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
@@ -118,7 +118,7 @@ serd_base64_decode(void* buf, size_t* size, const char* str, size_t len)
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) {