summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kadlec <jan.kadlec@nic.cz>2012-11-08 17:01:25 +0100
committerMarek Vavrusa <marek.vavrusa@nic.cz>2012-12-06 09:05:12 +0100
commit77d3c31b18c6d584cc0ba019610b59f8bebbef52 (patch)
tree8f5461b9e96446d77a017f4294cc676635794205
parentResponses to DS queries must be authoritative. (diff)
downloadknot-77d3c31b18c6d584cc0ba019610b59f8bebbef52.tar.xz
knot-77d3c31b18c6d584cc0ba019610b59f8bebbef52.zip
Rewritten assert into check.
- Added missing variable initializations. Fixes #2181 @1h
-rw-r--r--src/knot/zone/semantic-check.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/knot/zone/semantic-check.c b/src/knot/zone/semantic-check.c
index abc83eb6a..8c24b64a6 100644
--- a/src/knot/zone/semantic-check.c
+++ b/src/knot/zone/semantic-check.c
@@ -896,8 +896,8 @@ static int check_nsec3_node_in_zone(knot_zone_contents_t *zone, knot_node_t *nod
} else {
/* Unsecured delegation, check whether it is part of
* opt-out span */
- const knot_node_t *nsec3_previous;
- const knot_node_t *nsec3_node;
+ const knot_node_t *nsec3_previous = NULL;
+ const knot_node_t *nsec3_node = NULL;
if (knot_zone_contents_find_nsec3_for_name(zone,
knot_node_owner(node),
@@ -1480,6 +1480,12 @@ void log_cyclic_errors_in_zone(err_handler_t *handler,
{
if (do_checks == 3) {
/* Each NSEC3 node should only contain one RRSET. */
+ if (last_nsec3_node == NULL || first_nsec3_node == NULL) {
+ /* No NSEC3, but NSEC3PARAM present. */
+ err_handler_handle_error(handler, last_nsec3_node,
+ ZC_ERR_NSEC3_RDATA_CHAIN);
+ return;
+ }
assert(last_nsec3_node && first_nsec3_node);
const knot_rrset_t *nsec3_rrset =
knot_node_rrset(last_nsec3_node,