From: Ulrich Drepper Date: Wed, 21 Feb 2007 09:11:47 +0000 (+0000) Subject: * nscd/hstcache.c (cache_addhst): Remove unnecessary conditional. X-Git-Tag: cvs/fedora-glibc-20070221T1011~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8703f884991059dcaea8a78a4ae00ff7b1118eb;p=thirdparty%2Fglibc.git * 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. --- diff --git a/ChangeLog b/ChangeLog index a8652006250..3ef0f333ae0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-02-21 Ulrich Drepper + * 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. diff --git a/nscd/grpcache.c b/nscd/grpcache.c index 54d1ef1eeff..3852e8ca7f0 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 742491aea36..ad2e323eace 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 ea4fa351006..8c3a9516bab 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;