summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-01-17 10:42:43 +0000
committerJakub Jelinek <jakub@redhat.com>2007-01-17 10:42:43 +0000
commitaf98d46f5a025ae33c60ddb1a5edc753fb714bc5 (patch)
tree24a3c5cb0bfc6163b52ae74ac205f0e175beee87 /nis
parent1f09da09fed864c91288ff91295114fa5202edaa (diff)
downloadglibc-af98d46f5a025ae33c60ddb1a5edc753fb714bc5.tar.gz
glibc-af98d46f5a025ae33c60ddb1a5edc753fb714bc5.tar.xz
glibc-af98d46f5a025ae33c60ddb1a5edc753fb714bc5.zip
Updated to fedora-glibc-20070117T0857
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_compat/compat-grp.c6
-rw-r--r--nis/nss_nis/nis-service.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c
index f2f7195be1..236c84a20f 100644
--- a/nis/nss_compat/compat-grp.c
+++ b/nis/nss_compat/compat-grp.c
@@ -580,13 +580,17 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent,
       /* +group */
       if (result->gr_name[0] == '+' && result->gr_name[1] != '\0')
 	{
+	  /* Yes, no +1, see the memcpy call below.  */
+	  size_t len = strlen (result->gr_name);
+	  char buf[len];
 	  enum nss_status status;
 
 	  /* Store the group in the blacklist for the "+" at the end of
 	     /etc/group */
-	  blacklist_store_name (&result->gr_name[1], ent);
+	  memcpy (buf, &result->gr_name[1], len);
 	  status = getgrnam_plusgroup (&result->gr_name[1], result, ent,
 				       buffer, buflen, errnop);
+	  blacklist_store_name (buf, ent);
 	  if (status == NSS_STATUS_SUCCESS && result->gr_gid == gid)
 	    break;
 	  else
diff --git a/nis/nss_nis/nis-service.c b/nis/nss_nis/nis-service.c
index 0c176095c8..59a598f296 100644
--- a/nis/nss_nis/nis-service.c
+++ b/nis/nss_nis/nis-service.c
@@ -271,7 +271,7 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
 
   /* If the protocol is given, we could try if our NIS server knows
      about services.byservicename map. If yes, we only need one query.  */
-  size_t keylen = strlen (name) + 1 + (protocol ? strlen (protocol) : 0);
+  size_t keylen = strlen (name) + (protocol ? 1 + strlen (protocol) : 0);
   char key[keylen + 1];
 
   /* key is: "name/proto" */