* 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.
This commit is contained in:
Ulrich Drepper 2007-02-21 09:11:47 +00:00
parent 61705e06e1
commit c8703f8849
4 changed files with 11 additions and 4 deletions

View File

@ -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.

View 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;

View 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;

View 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;