From: Kurt Roeckx Date: Sat, 2 Jun 2018 16:15:32 +0000 (+0200) Subject: Fix checking the return value of getentropy() X-Git-Tag: OpenSSL_1_1_1-pre8~90 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1e653d0ff7fc2e06a1cb1e05c01feecde84e67d3;p=oweals%2Fopenssl.git Fix checking the return value of getentropy() Reviewed-by: Andy Polyakov GH: #6405 --- diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c index e698dfde65..9f17494d11 100644 --- a/crypto/rand/rand_unix.c +++ b/crypto/rand/rand_unix.c @@ -249,7 +249,7 @@ int syscall_random(void *buf, size_t buflen) */ p_getentropy.p = DSO_global_lookup("getentropy"); if (p_getentropy.p != NULL) - return p_getentropy.f(buf, buflen); + return p_getentropy.f(buf, buflen) == 0 ? buflen : 0; /* Linux supports this since version 3.17 */ # if defined(__linux) && defined(SYS_getrandom)