From ef4ae86af0e6c90d1f157b7af81b42b834286e45 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 11 Oct 2006 01:22:51 +0000 Subject: (nis_getnames): Make sure that we always return at least one entry consisting of the parameter concatenated with the domain. --- nis/nis_subr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nis/nis_subr.c b/nis/nis_subr.c index 40c9270501..93e34f13cb 100644 --- a/nis/nis_subr.c +++ b/nis/nis_subr.c @@ -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; -- cgit v1.2.1