add user load name length check

This commit is contained in:
Sen 2025-06-10 15:12:15 +02:00
parent 586b97e17b
commit 21b18d9809
Signed by: sen
GPG key ID: 3AC50A6F47D1B722

View file

@ -79,7 +79,7 @@ public class User {
}
private boolean fromJson(JsonObject obj) {
if(!Formatter.isValidUser(this.username))
if(this.username.length() < 3 || this.username.length() > 16 || !Formatter.isValidUser(this.username))
return false;
this.hash = obj.has("passwordHash") ? Formatter.fromHexString(obj.get("passwordHash").getAsString()) : null;
this.salt = obj.has("passwordSalt") ? Formatter.fromHexString(obj.get("passwordSalt").getAsString()) : null;