mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18: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.
|
||||
*/
|
||||
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