From c73b6c9ba513fea3e18b696e659049df69931171 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 11 Nov 2014 11:18:18 -0500 Subject: update to 1.0.0-1 version of the package --- src/libsodium/crypto_box/crypto_box_easy.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libsodium/crypto_box/crypto_box_easy.c') diff --git a/src/libsodium/crypto_box/crypto_box_easy.c b/src/libsodium/crypto_box/crypto_box_easy.c index 7224f24..7f39e22 100644 --- a/src/libsodium/crypto_box/crypto_box_easy.c +++ b/src/libsodium/crypto_box/crypto_box_easy.c @@ -1,4 +1,8 @@ +#include +#include +#include + #include "crypto_box.h" #include "crypto_secretbox.h" #include "utils.h" @@ -26,6 +30,9 @@ crypto_box_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) { + if (mlen > SIZE_MAX - crypto_box_MACBYTES) { + return -1; + } return crypto_box_detached(c + crypto_box_MACBYTES, c, m, mlen, n, pk, sk); } -- cgit v1.2.3