summaryrefslogtreecommitdiff
path: root/vendor/github.com/miekg/dns/msg.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-12-11 10:09:26 +0000
committerLibravatar GitHub <noreply@github.com>2023-12-11 10:09:26 +0000
commit9b03840b428838ed5a8cbabd0e38640f847edcbe (patch)
tree7d4c74b57b2b8761b93c16e38adbe3da21954c10 /vendor/github.com/miekg/dns/msg.go
parent[chore]: Bump golang.org/x/oauth2 from 0.13.0 to 0.15.0 (#2438) (diff)
downloadgotosocial-9b03840b428838ed5a8cbabd0e38640f847edcbe.tar.xz
[chore]: Bump github.com/miekg/dns from 1.1.56 to 1.1.57 (#2439)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.56 to 1.1.57. - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.56...v1.1.57) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/miekg/dns/msg.go')
-rw-r--r--vendor/github.com/miekg/dns/msg.go20
1 files changed, 9 insertions, 11 deletions
diff --git a/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/miekg/dns/msg.go
index b05cf14e9..8294d0395 100644
--- a/vendor/github.com/miekg/dns/msg.go
+++ b/vendor/github.com/miekg/dns/msg.go
@@ -501,30 +501,28 @@ func packTxtString(s string, msg []byte, offset int) (int, error) {
return offset, nil
}
-func packOctetString(s string, msg []byte, offset int, tmp []byte) (int, error) {
- if offset >= len(msg) || len(s) > len(tmp) {
+func packOctetString(s string, msg []byte, offset int) (int, error) {
+ if offset >= len(msg) || len(s) > 256*4+1 {
return offset, ErrBuf
}
- bs := tmp[:len(s)]
- copy(bs, s)
- for i := 0; i < len(bs); i++ {
+ for i := 0; i < len(s); i++ {
if len(msg) <= offset {
return offset, ErrBuf
}
- if bs[i] == '\\' {
+ if s[i] == '\\' {
i++
- if i == len(bs) {
+ if i == len(s) {
break
}
// check for \DDD
- if isDDD(bs[i:]) {
- msg[offset] = dddToByte(bs[i:])
+ if isDDD(s[i:]) {
+ msg[offset] = dddToByte(s[i:])
i += 2
} else {
- msg[offset] = bs[i]
+ msg[offset] = s[i]
}
} else {
- msg[offset] = bs[i]
+ msg[offset] = s[i]
}
offset++
}