Skip to content

Commit

Permalink
* nscd/hstcache.c (cache_addhst): Remove unnecessary conditional.
Browse files Browse the repository at this point in the history
	* nscd/servicescache.c (cache_addserv): Likewise.

	* nscd/grpcache.c (cache_addgr): In case a record changed on
	refresh, adjust key_copy.
  • Loading branch information
Ulrich Drepper committed Feb 21, 2007
1 parent 61705e0 commit c8703f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 1 addition & 0 deletions nscd/grpcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions nscd/hstcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions nscd/servicescache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c8703f8

Please sign in to comment.