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

String() in SVCBAlpn conversion doesn't escape properly #1361

Closed
shane-kerr opened this issue Apr 12, 2022 · 3 comments
Closed

String() in SVCBAlpn conversion doesn't escape properly #1361

shane-kerr opened this issue Apr 12, 2022 · 3 comments

Comments

@shane-kerr
Copy link
Contributor

I think the idea is that String() routines should provide something that is presentation format, suitable for DNS zone files.

The SVCBAlpn type contains an array of strings. If set via the unpack() function (or by direct initialization) it can contain non-printable characters, but the corresponding String() function does not attempt to escape them. Such DNS messages are bogus, of course, but such is DNS. The code in the SVCBLocal type properly escapes any values.

If this is a bug that makes sense to fix, I can submit a PR.

Note that the code in PR #1359 seems to have a similar issue.

@shane-kerr
Copy link
Contributor Author

Here's a simple program demonstrating the issue:
https://go.dev/play/p/QjQB7IRdRB0

@miekg
Copy link
Owner

miekg commented Apr 12, 2022

yes, Stringyfied value should be suitable for inclusion in zone files, so PR welcome.

thanks!

@shane-kerr
Copy link
Contributor Author

Fixes merged!

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

No branches or pull requests

2 participants