fix: possible nil ptr for invalid records like too long name

Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
This commit is contained in:
Sandor Szücs 2024-03-02 11:55:42 +01:00
parent 6cf4783a07
commit abf56c2240
No known key found for this signature in database
GPG Key ID: 2D7B996673E41107
2 changed files with 9 additions and 0 deletions

View File

@ -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 {

View File

@ -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),