summaryrefslogtreecommitdiff
path: root/nscd/initgrcache.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-06-12 16:53:43 +0000
committerJakub Jelinek <jakub@redhat.com>2008-06-12 16:53:43 +0000
commit72d4ac23660326e76443cf18f0ed8c2e4792d268 (patch)
treedec24311250bb61298456c3eb0e8937c3a4b7561 /nscd/initgrcache.c
parent8ba7d5cebbd4acf40dc8d22982baa50c2e1fd194 (diff)
Updated to fedora-glibc-20080612T1619cvs/fedora-glibc-2_8_90-6
Diffstat (limited to 'nscd/initgrcache.c')
-rw-r--r--nscd/initgrcache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index 3355df5164..c5693c6be5 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -246,7 +246,8 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
else
{
- written = total = sizeof (struct dataset) + start * sizeof (int32_t);
+ written = total = (offsetof (struct dataset, strdata)
+ + start * sizeof (int32_t));
/* If we refill the cache, first assume the reconrd did not
change. Allocate memory on the cache since it is likely
@@ -307,6 +308,9 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
/* Finally the user name. */
memcpy (cp, key, req->key_len);
+ assert (cp == dataset->strdata + total - offsetof (struct dataset,
+ strdata));
+
/* Now we can determine whether on refill we have to create a new
record or not. */
if (he != NULL)