提交 1e653d0f 编写于 作者: K Kurt Roeckx

Fix checking the return value of getentropy()

Reviewed-by: NAndy Polyakov <appro@openssl.org>
GH: #6405
上级 2545f944
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册