Skip to content
Snippets Groups Projects
Commit 190626e4 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

keymgr: fix json_pack() failure with NULL param

parent 26396985
No related branches found
No related tags found
1 merge request!547NSEC3 resalt
......@@ -282,7 +282,7 @@ static int export_zone_config(const dnssec_kasp_zone_t *zone, json_t **config_pt
}
_json_cleanup_ json_t *salt = NULL;
if (zone->nsec3_salt.data) {
if (zone->nsec3_salt.size > 0) {
r = encode_binary(&zone->nsec3_salt, &salt);
if (r != DNSSEC_EOK) {
return r;
......@@ -294,7 +294,9 @@ static int export_zone_config(const dnssec_kasp_zone_t *zone, json_t **config_pt
_json_cleanup_ json_t *salt_created = NULL;
r = encode_time(&zone->nsec3_salt_created, &salt_created);
if (r != DNSSEC_EOK) {
return DNSSEC_ENOMEM;
return r;
} else if (salt_created == NULL) {
salt_created = json_null();
}
_json_cleanup_ json_t *policy = zone->policy ? json_string(zone->policy) : json_null();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment