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

knsupdate: fix segfault when TSIG keyname not specified

Steps to reproduce:
$ knsupdate -y invalid

norefs
parent 6db495ad
No related branches found
No related tags found
No related merge requests found
......@@ -393,6 +393,12 @@ int params_parse_tsig(const char *value, knot_key_t *key)
k = h;
}
if (!s) {
ERR("invalid key option format, use [hmac:]keyname:secret\n");
free(h);
return KNOT_EINVAL;
}
/* Parse key name. */
key->name = create_fqdn_from_str(k, strlen(k));
key->secret = strdup(s);
......
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