only read first 64 bytes of wiiusgn key

This commit is contained in:
wish
2023-04-16 21:03:21 +10:00
parent 56ec654c72
commit 058c387b11

View File

@@ -143,7 +143,7 @@ func (s *Session) authenticate(username string, password string) {
func (s *Session) handleWIIUSGN(bf *byteframe.ByteFrame) {
_ = bf.ReadBytes(1)
wiiuKey := string(bf.ReadNullTerminatedBytes())
wiiuKey := string(bf.ReadBytes(64))
var reqUsername string
err := s.server.db.QueryRow(`SELECT username FROM users WHERE wiiu_key = $1`, wiiuKey).Scan(&reqUsername)
if err == sql.ErrNoRows {