getentropy() may be defined but NULL on older iOS versions

This commit is contained in:
Frank Denis
2019-06-02 21:11:30 +02:00
parent 6a6a5cc79e
commit d54f0721cd
@@ -180,6 +180,12 @@ static int
_randombytes_getentropy(void * const buf, const size_t size)
{
assert(size <= 256U);
/* LCOV_EXCL_START */
if (&getentropy == NULL) {
errno = ENOSYS;
return -1;
}
/* LCOV_EXCL_END */
if (getentropy(buf, size) != 0) {
return -1; /* LCOV_EXCL_LINE */
}