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

knot_dname_new_from_nonfqdn_str(): do not crash when input length is zero

parent f45e3d12
Branches
Tags v1.6.3
No related merge requests found
......@@ -434,7 +434,7 @@ knot_dname_t *knot_dname_new_from_nonfqdn_str(const char *name, uint size,
{
knot_dname_t *dname = NULL;
if (name[size - 1] != '.') {
if (size == 0 || name[size - 1] != '.') {
char *fqdn = strcdup(name, ".");
dname = knot_dname_new_from_str(fqdn, size + 1, node);
free(fqdn);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment