Skip to content

Commit

Permalink
libutee: Fix base64 encoding function
Browse files Browse the repository at this point in the history
Bitwise OR of unsigned int and a signed char is machine dependent and
could lead to invalid base64 encoding.

This commit makes it use unsigned char instead.

Signed-off-by: Krzysztof Jackiewicz <k.jackiewicz@samsung.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
kjackiewicz authored and jforissier committed Oct 8, 2018
1 parent 405c67d commit 70df09b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libutee/base64.c
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ bool base64_enc(const void *data, size_t dlen, char *buf, size_t *blen)
{
size_t n;
size_t boffs = 0;
const char *d = data;
const unsigned char *d = data;

n = base64_enc_len(dlen);
if (*blen < n) {

0 comments on commit 70df09b

Please sign in to comment.