summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-04-23 09:09:20 -0400
committerNick Mathewson <nickm@torproject.org>2015-04-23 09:09:20 -0400
commit55118d90ca927d2cdb2cbd92189113da4dcb2fe7 (patch)
tree4b36f953cd021b603c3ee8302c672410981d3831 /src/common/crypto.c
parent196499da73afa5c8000154aafe36c10b9ee43901 (diff)
downloadtor-55118d90ca927d2cdb2cbd92189113da4dcb2fe7.tar.gz
tor-55118d90ca927d2cdb2cbd92189113da4dcb2fe7.zip
Fix some implicit conversion warnings
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2cb1c39eb9..1b45639a7c 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -2496,6 +2496,8 @@ base64_encode(char *dest, size_t destlen, const char *src, size_t srclen,
return -1;
if (destlen > SIZE_T_CEILING)
return -1;
+ if (enclen > INT_MAX)
+ return -1;
memset(dest, 0, enclen);
@@ -2576,7 +2578,7 @@ base64_encode(char *dest, size_t destlen, const char *src, size_t srclen,
*d++ = '\0'; /* NUL terminate the output. */
- return enclen;
+ return (int) enclen;
}
#undef BASE64_OPENSSL_LINELEN