From 4ca8dfa37d2719f8272354c138de8412b55d4bf0 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 15 Mar 2023 17:32:44 +0100 Subject: [PATCH] downstream: fix nil pointer deref in downstreamConn.setUser References: https://lists.sr.ht/~emersion/soju-dev/%3CCR6PX9SU5FSO.3UR92LHKXOXML%40hades.moritz.sh%3E --- downstream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index f92707d..f2135dd 100644 --- a/downstream.go +++ b/downstream.go @@ -1249,7 +1249,7 @@ func unmarshalUsername(rawUsername string) (username, client, network string) { func (dc *downstreamConn) setUser(username, clientName, networkName string) error { dc.user = dc.srv.getUser(username) - if dc.user == nil && dc.user.srv.Config().EnableUsersOnAuth { + if dc.user == nil && dc.srv.Config().EnableUsersOnAuth { ctx := context.TODO() if _, err := dc.user.srv.db.GetUser(ctx, username); err != nil { // Can't find the user in the DB -- try to create it