]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* nscd/hstcache.c (cache_addhst): Remove unnecessary conditional.
authorUlrich Drepper <drepper@redhat.com>
Wed, 21 Feb 2007 09:11:47 +0000 (09:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 21 Feb 2007 09:11:47 +0000 (09:11 +0000)
* nscd/servicescache.c (cache_addserv): Likewise.

* nscd/grpcache.c (cache_addgr): In case a record changed on
refresh, adjust key_copy.

ChangeLog
nscd/grpcache.c
nscd/hstcache.c
nscd/servicescache.c

index a8652006250ed0c9c143ba6506244ad7b439e4af..3ef0f333ae00ef8b74d1b4a4366124c24d5ad63f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
 
+       * nscd/hstcache.c (cache_addhst): Remove unnecessary conditional.
+       * nscd/servicescache.c (cache_addserv): Likewise.
+
+       * nscd/grpcache.c (cache_addgr): In case a record changed on
+       refresh, adjust key_copy.
+
        [BZ #4074]
        * nscd/pwdcache.c (cache_addpw): In case a record changed on
        refresh, adjust key_copy.
index 54d1ef1eeff6f940dc980a9f95c35a3d79c76d13..3852e8ca7f03c079c7c5f0904be5492458807237 100644 (file)
@@ -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;
index 742491aea36ae98d31a708b53b21d6d4652b588e..ad2e323eace61a724662fb3a98a1f0ebad862e65 100644 (file)
@@ -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;
index ea4fa35100693231a36958ae87d69f9288690324..8c3a9516bab20ee7dea4cd320d30a50097a78a01 100644 (file)
@@ -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;