summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/ntp_crypto_rnd.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2016-01-11 01:09:50 +0000
committerglebius <glebius@FreeBSD.org>2016-01-11 01:09:50 +0000
commitc41fbaf9bc76f0b7650e448fbd88d0a9815f47fd (patch)
tree3b45c8e63a37b132f0fe10c570b8302052c547de /contrib/ntp/libntp/ntp_crypto_rnd.c
parent3066f138bc3bf99f5cf6ec9412903d206c329cc7 (diff)
downloadFreeBSD-src-c41fbaf9bc76f0b7650e448fbd88d0a9815f47fd.zip
FreeBSD-src-c41fbaf9bc76f0b7650e448fbd88d0a9815f47fd.tar.gz
Merge r293423, r293469:
ntp 4.2.8p5 Relnotes: yes
Diffstat (limited to 'contrib/ntp/libntp/ntp_crypto_rnd.c')
-rw-r--r--contrib/ntp/libntp/ntp_crypto_rnd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/ntp/libntp/ntp_crypto_rnd.c b/contrib/ntp/libntp/ntp_crypto_rnd.c
index 96348f2..2a4f91a 100644
--- a/contrib/ntp/libntp/ntp_crypto_rnd.c
+++ b/contrib/ntp/libntp/ntp_crypto_rnd.c
@@ -16,6 +16,7 @@
#include <l_stdlib.h>
#include <ntp_random.h>
+#include "safecast.h"
#ifdef USE_OPENSSL_CRYPTO_RAND
#include <openssl/err.h>
@@ -93,7 +94,7 @@ ntp_crypto_random_buf(
#ifdef USE_OPENSSL_CRYPTO_RAND
int rc;
- rc = RAND_bytes(buf, nbytes);
+ rc = RAND_bytes(buf, size2int_chk(nbytes));
if (1 != rc) {
unsigned long err;
char *err_str;
OpenPOWER on IntegriCloud