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