summaryrefslogtreecommitdiff
path: root/vendor/github.com/miekg/dns/scan.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-05-01 11:00:41 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-01 11:00:41 +0200
commit5904e3b4ee475076908d569afe816fd8a7e9d0d5 (patch)
treed2a60ddada251b2a800ee53439dba630684efb75 /vendor/github.com/miekg/dns/scan.go
parent[bugfix] tweak httpclient error handling again ... (#1721) (diff)
downloadgotosocial-5904e3b4ee475076908d569afe816fd8a7e9d0d5.tar.xz
[chore]: Bump github.com/miekg/dns from 1.1.53 to 1.1.54 (#1727)
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.53 to 1.1.54. - [Release notes](https://github.com/miekg/dns/releases) - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](https://github.com/miekg/dns/compare/v1.1.53...v1.1.54) --- 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/scan.go')
-rw-r--r--vendor/github.com/miekg/dns/scan.go20
1 files changed, 9 insertions, 11 deletions
diff --git a/vendor/github.com/miekg/dns/scan.go b/vendor/github.com/miekg/dns/scan.go
index 57be98827..3083c3e5f 100644
--- a/vendor/github.com/miekg/dns/scan.go
+++ b/vendor/github.com/miekg/dns/scan.go
@@ -10,13 +10,13 @@ import (
"strings"
)
-const maxTok = 2048 // Largest token we can return.
+const maxTok = 512 // Token buffer start size, and growth size amount.
// The maximum depth of $INCLUDE directives supported by the
// ZoneParser API.
const maxIncludeDepth = 7
-// Tokinize a RFC 1035 zone file. The tokenizer will normalize it:
+// Tokenize a RFC 1035 zone file. The tokenizer will normalize it:
// * Add ownernames if they are left blank;
// * Suppress sequences of spaces;
// * Make each RR fit on one line (_NEWLINE is send as last)
@@ -765,8 +765,8 @@ func (zl *zlexer) Next() (lex, bool) {
}
var (
- str [maxTok]byte // Hold string text
- com [maxTok]byte // Hold comment text
+ str = make([]byte, maxTok) // Hold string text
+ com = make([]byte, maxTok) // Hold comment text
stri int // Offset in str (0 means empty)
comi int // Offset in com (0 means empty)
@@ -785,14 +785,12 @@ func (zl *zlexer) Next() (lex, bool) {
l.line, l.column = zl.line, zl.column
if stri >= len(str) {
- l.token = "token length insufficient for parsing"
- l.err = true
- return *l, true
+ // if buffer length is insufficient, increase it.
+ str = append(str[:], make([]byte, maxTok)...)
}
if comi >= len(com) {
- l.token = "comment length insufficient for parsing"
- l.err = true
- return *l, true
+ // if buffer length is insufficient, increase it.
+ com = append(com[:], make([]byte, maxTok)...)
}
switch x {
@@ -816,7 +814,7 @@ func (zl *zlexer) Next() (lex, bool) {
if stri == 0 {
// Space directly in the beginning, handled in the grammar
} else if zl.owner {
- // If we have a string and its the first, make it an owner
+ // If we have a string and it's the first, make it an owner
l.value = zOwner
l.token = string(str[:stri])