Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty elements from @keys to resolve issue #727 #728

Merged
merged 1 commit into from
May 13, 2020

Conversation

matsduf
Copy link
Contributor

@matsduf matsduf commented May 12, 2020

Resolves issue #727.

Zonemaster::LDNS::RR::RRSIG::verify() requires that incoming parameter $keys is a reference to a non-empty array of DNSKEYs. Under some circumstances, @keys in Zonemaster::Engine::Test::DNSSEC::dnssec13() is created as an array of an empty key, and is then validated as non-empty and used in a call to Zonemaster::LDNS::RR::RRSIG::verify().

This update removes any empty element from @keys after it is created.

@matsduf matsduf added the A-TestCase Area: Test case specification or implementation of test case label May 12, 2020
@matsduf matsduf added this to the v2019.2.1 milestone May 12, 2020
@matsduf matsduf requested a review from vlevigneron May 12, 2020 19:27
@matsduf matsduf linked an issue May 12, 2020 that may be closed by this pull request
@@ -1880,6 +1880,14 @@ sub dnssec13 {

foreach my $sig ( @sigs ) {
my @keys = ($keytags{$sig->keytag});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the following line would be enough:
my @keys = grep { $_ } ($keytags{$sig->keytag});

@matsduf matsduf merged commit 06d5e5e into zonemaster:develop May 13, 2020
@matsduf matsduf deleted the fix-crash-in-dnssec13 branch May 13, 2020 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-TestCase Area: Test case specification or implementation of test case
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zonemaster crasches in DNSSEC13
2 participants