Skip to content

Commit

Permalink
(nis_getnames): Make sure that we always return at least one entry co…
Browse files Browse the repository at this point in the history
…nsisting of the parameter concatenated with the domain.
  • Loading branch information
Ulrich Drepper committed Oct 11, 2006
1 parent e2779f6 commit ef4ae86
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nis/nis_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ nis_getnames (const_nis_name name)
cp = __strtok_r (NULL, ":", &saveptr);
}

if (pos == 0
&& __asprintf (&getnames[pos++], "%s%s%s%s",
name, name[name_len - 1] == '.' ? "" : ".",
local_domain,
local_domain[local_domain_len - 1] == '.' ? "" : ".") < 0)
goto free_null;

getnames[pos] = NULL;

return getnames;
Expand Down

0 comments on commit ef4ae86

Please sign in to comment.