diff --git a/src/storage.cr b/src/storage.cr index bd5dd03..dec3a0f 100644 --- a/src/storage.cr +++ b/src/storage.cr @@ -133,6 +133,8 @@ class DNSManager::Storage end matching_domains.each do |md| + # Prevent empty domains (from crafted requests) to be accepted. + return Response::InvalidDomainName.new unless (domain.chomp md).size > 2 Baguette::Log.info "Add new domain #{domain} (matching domain #{md})" end