Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic in client.go if stamp DNS response has no TXT records (and under other conditions) #18

Closed
ainar-g opened this issue Mar 3, 2023 · 0 comments · Fixed by #19
Closed

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Mar 3, 2023

See AdguardTeam/AdGuardHome#5557. Client.DialStamp uses Client.fetchCert, which has bad error handling. certErr is overwritten on every iteration of the loop over r.Answer and is never set at all if there are no answers or if none of the answers are TXT. That results in Client.fetchCert returning nil, nil, which leads to a panic in Client.DialStamp.

Client.fetchCert has a cyclomatic complexity of 14 and a cognitive complexity of 23 and needs refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant