Skip to content

Commit 7571b03

Browse files
committed
Ignore nil client addresses
1 parent 3b64a4a commit 7571b03

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dnscrypt-proxy/common.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ func isDigit(b byte) bool { return b >= '0' && b <= '9' }
180180

181181
// ExtractClientIPStr extracts client IP string from pluginsState based on protocol
182182
func ExtractClientIPStr(pluginsState *PluginsState) (string, bool) {
183+
if pluginsState.clientAddr == nil {
184+
return "", false
185+
}
183186
switch pluginsState.clientProto {
184187
case "udp":
185188
return (*pluginsState.clientAddr).(*net.UDPAddr).IP.String(), true

0 commit comments

Comments
 (0)