diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-26 01:44:20 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-26 03:50:38 +0700 |
| commit | 15a2eb28b958e3cdeb3cdb7d2166f505701a00c0 (patch) | |
| tree | 7309d91f78dc7f2d33c8a4a9642e5d16f404c6e4 | |
| parent | fc20219018dd3b259d0a8d0e790267b6bf37b0b2 (diff) | |
| download | pakakeh.go-15a2eb28b958e3cdeb3cdb7d2166f505701a00c0.tar.xz | |
lib/dns: use ParseUint to parse escaped octet in "\NNN" format
Previously, we use ParseInt to parse escaped octet "\NNN", but using
this method only allow decimal from 0 to 127, while the specification
allow 0 to 255.
| -rw-r--r-- | lib/dns/zone_parser.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dns/zone_parser.go b/lib/dns/zone_parser.go index 6b477ba4..e648e43b 100644 --- a/lib/dns/zone_parser.go +++ b/lib/dns/zone_parser.go @@ -975,8 +975,8 @@ func (m *zoneParser) decodeString(in []byte) (out []byte, err error) { } x-- - var vint int64 - vint, err = strconv.ParseInt(string(digits), 10, 8) + var vint uint64 + vint, err = strconv.ParseUint(string(digits), 10, 8) if err != nil { return nil, fmt.Errorf(`%s: invalid octet: \%s`, logp, digits) } |
