mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Auth: free string after use
This commit is contained in:
parent
dc7b386295
commit
8d0cb2e875
11
Config.cpp
11
Config.cpp
@ -167,13 +167,16 @@ bool Config::CheckAuth(const char *response)
|
|||||||
mbedtls_base64_encode(expected_response, 64, &base64_size, hash, 32);
|
mbedtls_base64_encode(expected_response, 64, &base64_size, hash, 32);
|
||||||
expected_response[64] = 0; // Null-terminate the string
|
expected_response[64] = 0; // Null-terminate the string
|
||||||
|
|
||||||
|
bool authSuccess = false;
|
||||||
if (strcmp((char*)expected_response, response) == 0) {
|
if (strcmp((char*)expected_response, response) == 0) {
|
||||||
SessionChallenge = GenerateSalt();
|
SessionChallenge = GenerateSalt();
|
||||||
return true;
|
authSuccess = true;
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bfree(challengeAndResponse);
|
||||||
|
bfree(expected_response);
|
||||||
|
|
||||||
|
return authSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
Config* Config::Current()
|
Config* Config::Current()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user