aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-10-11 01:28:34 +0000
committerUlrich Drepper <drepper@redhat.com>2006-10-11 01:28:34 +0000
commit2a6ee54934756720c5e93a4f09e85929c49596dc (patch)
tree0e75f1e3c4b2421d050fd355ef28a9da5644a07b
parentef4ae86af0e6c90d1f157b7af81b42b834286e45 (diff)
downloadglibc-2a6ee54934756720c5e93a4f09e85929c49596dc.zip
glibc-2a6ee54934756720c5e93a4f09e85929c49596dc.tar.gz
glibc-2a6ee54934756720c5e93a4f09e85929c49596dc.tar.bz2
* nis/nis_subr.c (nis_getnames): Add trailing dot to NIS_PATH
components which lack them. * nis/nis_subr.c (nis_getnames): Make sure that we always return at least one entry consisting of the parameter concatenated with the domain.
-rw-r--r--ChangeLog9
-rw-r--r--nis/nis_subr.c9
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7279f5f..4355bf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-10 Ulrich Drepper <drepper@redhat.com>
+
+ * nis/nis_subr.c (nis_getnames): Add trailing dot to NIS_PATH
+ components which lack them.
+
+ * nis/nis_subr.c (nis_getnames): Make sure that we always return
+ at least one entry consisting of the parameter concatenated with
+ the domain.
+
2006-10-10 Roland McGrath <roland@frob.com>
* sysdeps/mach/hurd/utimes.c: Use a union to avoid an improper cast.
diff --git a/nis/nis_subr.c b/nis/nis_subr.c
index 93e34f1..c68189e 100644
--- a/nis/nis_subr.c
+++ b/nis/nis_subr.c
@@ -251,13 +251,16 @@ nis_getnames (const_nis_name name)
{
char *p;
- tmp = malloc (cplen + name_len + 2);
+ tmp = malloc (cplen + name_len + 3);
if (__builtin_expect (tmp == NULL, 0))
goto free_null;
- p = __stpcpy (tmp, name);
+ p = __mempcpy (tmp, name, name_len);
*p++ = '.';
- memcpy (p, cp, cplen + 1);
+ p = __mempcpy (p, cp, cplen);
+ if (p[-1] != '.')
+ *p++ = '.';
+ *p = '\0';
}
if (pos >= count)