Skip to content

Commit

Permalink
fix: possible nil ptr for invalid records like too long name
Browse files Browse the repository at this point in the history
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
  • Loading branch information
szuecs committed Mar 2, 2024
1 parent 6cf4783 commit abf56c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions provider/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*route53.Hos
}

for _, ep := range newEndpoints {
if ep == nil {
continue
}
if r.SetIdentifier != nil {
ep.SetIdentifier = aws.StringValue(r.SetIdentifier)
switch {
Expand Down
6 changes: 6 additions & 0 deletions provider/aws/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ func TestAWSRecords(t *testing.T) {
TTL: aws.Int64(recordTTL),
ResourceRecords: []*route53.ResourceRecord{{Value: aws.String("8.8.8.8")}},
},
{
Name: aws.String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.ext-dns-test-2.teapot.zalan.do."),
Type: aws.String(route53.RRTypeA),
TTL: aws.Int64(recordTTL),
ResourceRecords: []*route53.ResourceRecord{},
},
{
Name: aws.String("*.wildcard-test.zone-2.ext-dns-test-2.teapot.zalan.do."),
Type: aws.String(route53.RRTypeA),
Expand Down

0 comments on commit abf56c2

Please sign in to comment.