mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-31 20:04:09 +00:00
Add password length check
Don't allow setting a too long password.
This commit is contained in:
parent
3c77eaa1d7
commit
939e643c2a
@ -3503,6 +3503,8 @@ SPICE_GNUC_VISIBLE int spice_server_set_ticket(SpiceServer *s,
|
||||
taTicket.expiration_time = now + lifetime;
|
||||
}
|
||||
if (passwd != NULL) {
|
||||
if (strlen(passwd) > SPICE_MAX_PASSWORD_LENGTH)
|
||||
return -1;
|
||||
g_strlcpy(taTicket.password, passwd, sizeof(taTicket.password));
|
||||
} else {
|
||||
memset(taTicket.password, 0, sizeof(taTicket.password));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user