mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
bin/ircd: restrict nicknamesn to have a maximum length of nine characters
This commit is contained in:
@@ -59,6 +59,10 @@ impl ProtocolPrivmsg {
|
||||
loop {
|
||||
let msg = self.msg_sub.receive().await?;
|
||||
|
||||
if msg.nickname.len() > 10 {
|
||||
continue
|
||||
}
|
||||
|
||||
if self.msg_ids.lock().await.contains(&msg.id) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -111,6 +111,11 @@ impl IrcServerConnection {
|
||||
}
|
||||
"NICK" => {
|
||||
let nickname = tokens.next().ok_or(Error::MalformedPacket)?;
|
||||
|
||||
if nickname.len() > 10 {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
self.is_nick_init = true;
|
||||
let old_nick = std::mem::replace(&mut self.nickname, nickname.to_string());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user