Skip to content

Commit 5fd208a

Browse files
committed
Fix security issue
1 parent 8da8026 commit 5fd208a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ONetLoginHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ public void a(String s) {
5454
}
5555

5656
public void a(OPacket2ClientProtocol opacket2clientprotocol) {
57+
if (this.g != null) {
58+
this.a(this.g.equalsIgnoreCase(opacket2clientprotocol.f()) ? "Quit repeating yourself." : "You just told me something else!");
59+
return;
60+
}
5761
this.g = opacket2clientprotocol.f();
58-
if (!this.g.toLowerCase().matches("[a-z0-9_]+")) {
62+
if (!this.g.toLowerCase().matches("[a-z0-9_-]{2,16}")) {
5963
this.a("Invalid username!");
6064
} else {
6165
PublicKey publickey = this.e.H().getPublic();

0 commit comments

Comments
 (0)