1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 20:15:19 -07:00

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

This commit is contained in:
Frank Denis 2019-06-02 21:11:13 +02:00
parent 6a6a5cc79e
commit d54f0721cd

View File

@ -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 */
}