forked from External/ergo
Avoiding a crash when getting a short ident is a good thing
This commit is contained in:
parent
151002e232
commit
e8309aee79
2 changed files with 9 additions and 2 deletions
|
|
@ -176,7 +176,10 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) {
|
|||
client.Notice(client.t("*** Looking up your username"))
|
||||
resp, err := ident.Query(clientHost, serverPort, clientPort, IdentTimeoutSeconds)
|
||||
if err == nil {
|
||||
ident := resp.Identifier[:config.Limits.IdentLen-1]
|
||||
ident := resp.Identifier
|
||||
if config.Limits.IdentLen < len(ident) {
|
||||
ident = ident[:config.Limits.IdentLen]
|
||||
}
|
||||
if isIdent(ident) {
|
||||
identLower := strings.ToLower(ident) // idents can only be ASCII chars only
|
||||
client.Notice(client.t("*** Found your username"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue