diff --git a/src/libsodium/crypto_box/crypto_box_easy.c b/src/libsodium/crypto_box/crypto_box_easy.c index 2992db80..4687cf90 100644 --- a/src/libsodium/crypto_box/crypto_box_easy.c +++ b/src/libsodium/crypto_box/crypto_box_easy.c @@ -24,11 +24,11 @@ crypto_box_easy(unsigned char *c, const unsigned char *m, (void) sizeof(char[crypto_box_ZEROBYTES >= crypto_box_BOXZEROBYTES ? 1 : -1]); m_boxed_len = (size_t) mlen + crypto_box_ZEROBYTES; - if ((m_boxed = malloc((size_t) m_boxed_len)) == NULL) { + if ((m_boxed = (unsigned char *) malloc((size_t) m_boxed_len)) == NULL) { return -1; } c_boxed_len = (size_t) mlen + crypto_box_ZEROBYTES; - if ((c_boxed = malloc(c_boxed_len)) == NULL) { + if ((c_boxed = (unsigned char *) malloc(c_boxed_len)) == NULL) { free(m_boxed); return -1; } @@ -65,13 +65,13 @@ crypto_box_open_easy(unsigned char *m, const unsigned char *c, return -1; } c_boxed_len = clen + crypto_box_BOXZEROBYTES; - if ((c_boxed = malloc(c_boxed_len)) == NULL) { + if ((c_boxed = (unsigned char *) malloc(c_boxed_len)) == NULL) { return -1; } memset(c_boxed, 0, crypto_box_BOXZEROBYTES); memcpy(c_boxed + crypto_box_BOXZEROBYTES, c, clen); m_boxed_len = c_boxed_len + crypto_box_MACBYTES; - if ((m_boxed = malloc(m_boxed_len)) == NULL) { + if ((m_boxed = (unsigned char *) malloc(m_boxed_len)) == NULL) { return -1; } rc = crypto_box_open(m_boxed, c_boxed,