Skip to content
Snippets Groups Projects
Commit f4fc5b32 authored by Jan Hák's avatar Jan Hák Committed by Daniel Salzman
Browse files

utils: add condition for zero-length string in get_fqd_name()

parent 51a9ce95
No related branches found
No related tags found
No related merge requests found
......@@ -217,7 +217,7 @@ char *get_fqd_name(const char *name)
size_t name_len = strlen(name);
// If the name is FQDN, make a copy.
if (name[name_len - 1] == '.') {
if (name_len > 0 && name[name_len - 1] == '.') {
fqd_name = strdup(name);
// Else make a copy and append a trailing dot.
} else {
......
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