提交 1381684d 编写于 作者: G ganesh 提交者: Richard Levitte

Fixed the return code of RAND_query_egd_bytes when connect fails.

Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1886)
上级 8f77fab8
......@@ -133,6 +133,7 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
break;
# endif
default:
ret = -1;
goto err; /* failure */
}
}
......@@ -230,9 +231,7 @@ int RAND_egd_bytes(const char *path, int bytes)
int num, ret = 0;
num = RAND_query_egd_bytes(path, NULL, bytes);
if (num < 1)
goto err;
if (RAND_status() == 1)
if (num < 1 || 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.
先完成此消息的编辑!
想要评论请 注册