mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 06:20:06 +00:00
Clear array before use.
* nscd/hstcache.c (cache_addhst): Likewise. * nscd/grpcache.c (cache_addgr): Likewise. * nscd/servicescache.c (cache_addserv): Likewise. * nscd/pwdcache.c (cache_addpw): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise.
This commit is contained in:
parent
30294ea449
commit
e8667ddc01
@ -4,10 +4,15 @@
|
|||||||
* nscd/mem.c (MAX_STACK_USE): Remove definition here.
|
* nscd/mem.c (MAX_STACK_USE): Remove definition here.
|
||||||
(gc): Initialize stack_used based on allocation in prune_cache.
|
(gc): Initialize stack_used based on allocation in prune_cache.
|
||||||
* nscd/cache.c (prune_cache): Use heap for mark array if necessary.
|
* nscd/cache.c (prune_cache): Use heap for mark array if necessary.
|
||||||
Clear array bfore use.
|
Clear array before use.
|
||||||
|
|
||||||
* nscd/aicache.c (addhstaiX): Update statistics counter in case
|
* nscd/aicache.c (addhstaiX): Update statistics counter in case
|
||||||
memory allocate failed.
|
memory allocate failed.
|
||||||
|
* nscd/hstcache.c (cache_addhst): Likewise.
|
||||||
|
* nscd/grpcache.c (cache_addgr): Likewise.
|
||||||
|
* nscd/servicescache.c (cache_addserv): Likewise.
|
||||||
|
* nscd/pwdcache.c (cache_addpw): Likewise.
|
||||||
|
* nscd/initgrcache.c (addinitgroupsX): Likewise.
|
||||||
|
|
||||||
2007-11-23 Ulrich Drepper <drepper@redhat.com>
|
2007-11-23 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
@ -285,6 +285,8 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
|
|||||||
dataset = memcpy (newp, dataset, total + n);
|
dataset = memcpy (newp, dataset, total + n);
|
||||||
alloca_used = false;
|
alloca_used = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
++db->head->addfailed;
|
||||||
|
|
||||||
/* Mark the old record as obsolete. */
|
/* Mark the old record as obsolete. */
|
||||||
dh->usable = false;
|
dh->usable = false;
|
||||||
|
@ -325,6 +325,8 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
|
|||||||
dataset = memcpy (newp, dataset, total + req->key_len);
|
dataset = memcpy (newp, dataset, total + req->key_len);
|
||||||
alloca_used = false;
|
alloca_used = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
++db->head->addfailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark the old record as obsolete. */
|
/* Mark the old record as obsolete. */
|
||||||
|
@ -110,7 +110,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
|||||||
bool all_tryagain = true;
|
bool all_tryagain = true;
|
||||||
bool any_success = false;
|
bool any_success = false;
|
||||||
|
|
||||||
/* This is temporary memory, we need not (ad must not) call
|
/* This is temporary memory, we need not (and must not) call
|
||||||
mempool_alloc. */
|
mempool_alloc. */
|
||||||
// XXX This really should use alloca. need to change the backends.
|
// XXX This really should use alloca. need to change the backends.
|
||||||
gid_t *groups = (gid_t *) malloc (size * sizeof (gid_t));
|
gid_t *groups = (gid_t *) malloc (size * sizeof (gid_t));
|
||||||
@ -338,6 +338,8 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
|||||||
dataset = memcpy (newp, dataset, total + req->key_len);
|
dataset = memcpy (newp, dataset, total + req->key_len);
|
||||||
alloca_used = false;
|
alloca_used = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
++db->head->addfailed;
|
||||||
|
|
||||||
/* Mark the old record as obsolete. */
|
/* Mark the old record as obsolete. */
|
||||||
dh->usable = false;
|
dh->usable = false;
|
||||||
|
@ -280,6 +280,8 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
|
|||||||
dataset = memcpy (newp, dataset, total + n);
|
dataset = memcpy (newp, dataset, total + n);
|
||||||
alloca_used = false;
|
alloca_used = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
++db->head->addfailed;
|
||||||
|
|
||||||
/* Mark the old record as obsolete. */
|
/* Mark the old record as obsolete. */
|
||||||
dh->usable = false;
|
dh->usable = false;
|
||||||
|
@ -272,6 +272,8 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
|
|||||||
dataset = memcpy (newp, dataset, total + req->key_len);
|
dataset = memcpy (newp, dataset, total + req->key_len);
|
||||||
alloca_used = false;
|
alloca_used = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
++db->head->addfailed;
|
||||||
|
|
||||||
/* Mark the old record as obsolete. */
|
/* Mark the old record as obsolete. */
|
||||||
dh->usable = false;
|
dh->usable = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user