about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/digits_dots.c3
-rw-r--r--nss/getXXbyYY.c1
-rw-r--r--nss/nsswitch.c3
3 files changed, 3 insertions, 4 deletions
diff --git a/nss/digits_dots.c b/nss/digits_dots.c
index dab64bfe1f..29aa5b1c5c 100644
--- a/nss/digits_dots.c
+++ b/nss/digits_dots.c
@@ -246,8 +246,7 @@
 		      goto done;
 		    }
 
-		  strcpy (hostname, name);
-		  resbuf.h_name = hostname;
+		  resbuf.h_name = strcpy (hostname, name);
 		  resbuf.h_aliases = *host_aliases;
 		  (*host_aliases)[0] = NULL;
 		  (*h_addr_ptrs)[0] = (char *) host_addr;
diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c
index 47df15b034..0df916b1ed 100644
--- a/nss/getXXbyYY.c
+++ b/nss/getXXbyYY.c
@@ -117,6 +117,7 @@ FUNCTION_NAME (ADD_PARAMS)
 	     process gets a chance for a normal termination.  */
 	  save = errno;
 	  free (buffer);
+	  buffer = NULL;
 	  __set_errno (save);
 	}
       buffer = new_buf;
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 18129bb5c0..36c1d0035e 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -587,8 +587,7 @@ nss_parse_service_list (const char *line)
 	      free (new_service);
 	      return result;
 	    }
-	  memcpy (source, name, line - name);
-	  source[line - name] = '\0';
+	  *((char *) __mempcpy (source, name, line - name)) = '\0';
 
 	  new_service->name = source;
 	}