Skip to content

Commit 92728b3

Browse files
mateusz834gopherbot
authored andcommitted
dns/dnsmessage: document that Skip does not fully validate the header
The Skip methods do not fully validate the name in header, the compression pointers are not followed Change-Id: If34a041d799a22117afac9bd23e76606f5d0c8f7 GitHub-Last-Rev: f8f2586 GitHub-Pull-Request: #196 Reviewed-on: https://go-review.googlesource.com/c/net/+/534175 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Damien Neil <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent b225e7c commit 92728b3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dns/dnsmessage/message.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,9 @@ func (p *Parser) AllAnswers() ([]Resource, error) {
751751
}
752752

753753
// SkipAnswer skips a single Answer Resource.
754+
//
755+
// It does not perform a complete validation of the resource header, which means
756+
// it may return a nil error when the [AnswerHeader] would actually return an error.
754757
func (p *Parser) SkipAnswer() error {
755758
return p.skipResource(sectionAnswers)
756759
}
@@ -801,6 +804,9 @@ func (p *Parser) AllAuthorities() ([]Resource, error) {
801804
}
802805

803806
// SkipAuthority skips a single Authority Resource.
807+
//
808+
// It does not perform a complete validation of the resource header, which means
809+
// it may return a nil error when the [AuthorityHeader] would actually return an error.
804810
func (p *Parser) SkipAuthority() error {
805811
return p.skipResource(sectionAuthorities)
806812
}
@@ -851,6 +857,9 @@ func (p *Parser) AllAdditionals() ([]Resource, error) {
851857
}
852858

853859
// SkipAdditional skips a single Additional Resource.
860+
//
861+
// It does not perform a complete validation of the resource header, which means
862+
// it may return a nil error when the [AdditionalHeader] would actually return an error.
854863
func (p *Parser) SkipAdditional() error {
855864
return p.skipResource(sectionAdditionals)
856865
}

0 commit comments

Comments
 (0)