mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #8398 from Robyt3/Base-secure_random_init-check
Ensure return value of `secure_random_init` is always checked
This commit is contained in:
commit
5ad62b5732
|
@ -2637,7 +2637,7 @@ void generate_password(char *buffer, unsigned length, const unsigned short *rand
|
||||||
*
|
*
|
||||||
* @return `0` on success.
|
* @return `0` on success.
|
||||||
*/
|
*/
|
||||||
int secure_random_init();
|
[[nodiscard]] int secure_random_init();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uninitializes the secure random module.
|
* Uninitializes the secure random module.
|
||||||
|
|
|
@ -6,8 +6,12 @@ int main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
CCmdlineFix CmdlineFix(&argc, &argv);
|
CCmdlineFix CmdlineFix(&argc, &argv);
|
||||||
|
|
||||||
secure_random_init();
|
|
||||||
log_set_global_logger_default();
|
log_set_global_logger_default();
|
||||||
|
if(secure_random_init() != 0)
|
||||||
|
{
|
||||||
|
log_error("stun", "could not initialize secure RNG");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,8 +11,12 @@ int main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
CCmdlineFix CmdlineFix(&argc, &argv);
|
CCmdlineFix CmdlineFix(&argc, &argv);
|
||||||
|
|
||||||
secure_random_init();
|
|
||||||
log_set_global_logger_default();
|
log_set_global_logger_default();
|
||||||
|
if(secure_random_init() != 0)
|
||||||
|
{
|
||||||
|
log_error("twping", "could not initialize secure RNG");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
net_init();
|
net_init();
|
||||||
NETADDR BindAddr;
|
NETADDR BindAddr;
|
||||||
|
|
Loading…
Reference in a new issue