提交 3ed93c86 编写于 作者: G ganesh 提交者: Richard Levitte

Fixed the return code for RAND_egd_bytes.

According to the documentation, the return code should be -1 when
RAND_status does not return 1.
Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1886)
上级 1381684d
......@@ -228,10 +228,10 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
int RAND_egd_bytes(const char *path, int bytes)
{
int num, ret = 0;
int num, ret = -1;
num = RAND_query_egd_bytes(path, NULL, bytes);
if (num < 1 || RAND_status() == 1)
if (RAND_status() == 1)
ret = num;
err:
return (ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册