parent
3794405101
commit
bdadcad1c8
|
@ -609,7 +609,8 @@ bool crypto_rsa_priv_key_load(struct crypto_rsa_priv_key* priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
char head[128];
|
char head[128];
|
||||||
strlcpy(head, line, sizeof(head));
|
strncpy(head, line, sizeof(head));
|
||||||
|
head[sizeof(head) - 1] = '\0';
|
||||||
char* end = strchr(head, '\n');
|
char* end = strchr(head, '\n');
|
||||||
if (end)
|
if (end)
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
|
|
@ -755,9 +755,11 @@ static int on_rsa_aes_credentials(struct nvnc_client* client)
|
||||||
char username[256];
|
char username[256];
|
||||||
char password[256];
|
char password[256];
|
||||||
|
|
||||||
strlcpy(username, (const char*)(msg + 1), username_len + 1);
|
strncpy(username, (const char*)(msg + 1), username_len + 1);
|
||||||
strlcpy(password, (const char*)(msg + 2 + username_len),
|
username[sizeof(username) - 1] = '\0';
|
||||||
|
strncpy(password, (const char*)(msg + 2 + username_len),
|
||||||
password_len + 1);
|
password_len + 1);
|
||||||
|
password[sizeof(password) - 1] = '\0';
|
||||||
|
|
||||||
if (server->auth_fn(username, password, server->auth_ud)) {
|
if (server->auth_fn(username, password, server->auth_ud)) {
|
||||||
nvnc_log(NVNC_LOG_INFO, "User \"%s\" authenticated", username);
|
nvnc_log(NVNC_LOG_INFO, "User \"%s\" authenticated", username);
|
||||||
|
|
Loading…
Reference in New Issue