1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 10949b775aab6fc0e708cae9479a8ee891f50c08
Author: Noriko Hosoi <nhosoi@redhat.com>
Date: Wed Jun 22 11:25:33 2016 -0700
Ticket #48899 - Values of dbcachetries/dbcachehits in cn=monitor could overflow.
Description: The internal variable cache_tries is declared as u_int32_t.
The values provided from Berkeley DB are typed as uintmax_t, which has
64 bit width. Since cache_tries stores the sum of st_cache_miss and
mpstat->st_cache_hit, the type should be also uintmax_t so that the
overflow problem is solved.
https://fedorahosted.org/389/ticket/48899
Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
diff --git a/ldap/servers/slapd/back-ldbm/monitor.c b/ldap/servers/slapd/back-ldbm/monitor.c
index b89f6cb..dfcc735 100644
--- a/ldap/servers/slapd/back-ldbm/monitor.c
+++ b/ldap/servers/slapd/back-ldbm/monitor.c
@@ -226,7 +226,7 @@ int ldbm_back_monitor_search(Slapi_PBlock *pb, Slapi_Entry *e,
char buf[BUFSIZ];
DB_MPOOL_STAT *mpstat = NULL;
DB_MPOOL_FSTAT **mpfstat = NULL;
- u_int32_t cache_tries;
+ uintmax_t cache_tries;
vals[0] = &val;
vals[1] = NULL;
@@ -247,7 +247,7 @@ int ldbm_back_monitor_search(Slapi_PBlock *pb, Slapi_Entry *e,
/* cache tries*/
cache_tries = (mpstat->st_cache_miss + mpstat->st_cache_hit);
- sprintf(buf, "%u", cache_tries);
+ sprintf(buf, "%lu", cache_tries);
MSET("dbCacheTries");
/* cache hit ratio*/
--
389-commits mailing list
389-commits@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org
No comments:
Post a Comment