summary refs log tree commit diff
path: root/nscd
diff options
context:
space:
mode:
Diffstat (limited to 'nscd')
-rw-r--r--nscd/grpcache.c1
-rw-r--r--nscd/hstcache.c4
-rw-r--r--nscd/servicescache.c4
3 files changed, 5 insertions, 4 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index 54d1ef1eef..3852e8ca7f 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -279,6 +279,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
 		  /* Adjust pointers into the memory block.  */
 		  gr_name = (char *) newp + (gr_name - (char *) dataset);
 		  cp = (char *) newp + (cp - (char *) dataset);
+		  key_copy = (char *) newp + (key_copy - (char *) dataset);
 
 		  dataset = memcpy (newp, dataset, total + n);
 		  alloca_used = false;
diff --git a/nscd/hstcache.c b/nscd/hstcache.c
index 742491aea3..ad2e323eac 100644
--- a/nscd/hstcache.c
+++ b/nscd/hstcache.c
@@ -311,8 +311,8 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
 		  /* Adjust pointers into the memory block.  */
 		  addresses = (char *) newp + (addresses - (char *) dataset);
 		  aliases = (char *) newp + (aliases - (char *) dataset);
-		  if (key_copy != NULL)
-		    key_copy = (char *) newp + (key_copy - (char *) dataset);
+		  assert (key_copy != NULL);
+		  key_copy = (char *) newp + (key_copy - (char *) dataset);
 
 		  dataset = memcpy (newp, dataset, total + req->key_len);
 		  alloca_used = false;
diff --git a/nscd/servicescache.c b/nscd/servicescache.c
index ea4fa35100..8c3a9516ba 100644
--- a/nscd/servicescache.c
+++ b/nscd/servicescache.c
@@ -264,8 +264,8 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
 		{
 		  /* Adjust pointers into the memory block.  */
 		  aliases = (char *) newp + (aliases - (char *) dataset);
-		  if (key_copy != NULL)
-		    key_copy = (char *) newp + (key_copy - (char *) dataset);
+		  assert (key_copy != NULL);
+		  key_copy = (char *) newp + (key_copy - (char *) dataset);
 
 		  dataset = memcpy (newp, dataset, total + req->key_len);
 		  alloca_used = false;