mirror of git://sourceware.org/git/glibc.git
(nis_getnames): Make sure that we always return at least one entry consisting of the parameter concatenated with the domain.
This commit is contained in:
parent
e2779f6012
commit
ef4ae86af0
|
|
@ -275,6 +275,13 @@ nis_getnames (const_nis_name name)
|
||||||
cp = __strtok_r (NULL, ":", &saveptr);
|
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;
|
getnames[pos] = NULL;
|
||||||
|
|
||||||
return getnames;
|
return getnames;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue