diff options
author | Micah Anderson <micah@riseup.net> | 2014-11-11 11:18:18 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2014-11-11 11:18:18 -0500 |
commit | c73b6c9ba513fea3e18b696e659049df69931171 (patch) | |
tree | a001cd6acbecead76b9a55f324278e8d077fe3d5 /src/libsodium/crypto_box/crypto_box_easy.c | |
parent | eabdc6e3d62550679476899dd861c23b63937142 (diff) |
update to 1.0.0-1 version of the package
Diffstat (limited to 'src/libsodium/crypto_box/crypto_box_easy.c')
-rw-r--r-- | src/libsodium/crypto_box/crypto_box_easy.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 <limits.h> +#include <stdint.h> +#include <stdlib.h> + #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); } |