提交 0c27ce73 编写于 作者: N nia 提交者: Matt Caswell

rand_unix.c: Only enable hack for old FreeBSD versions on FreeBSD

Reviewed-by: NPaul Dale <paul.dale@oracle.com>
Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11689)
上级 e2e4b784
......@@ -227,10 +227,12 @@ static ssize_t sysctl_random(char *buf, size_t buflen)
* when the sysctl returns long and we want to request something not a
* multiple of longs, which should never be the case.
*/
#if defined(__FreeBSD__)
if (!ossl_assert(buflen % sizeof(long) == 0)) {
errno = EINVAL;
return -1;
}
#endif
/*
* On NetBSD before 4.0 KERN_ARND was an alias for KERN_URND, and only
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册