From 459a6c9bdf30192dbf794d166277b4018c7b79f7 Mon Sep 17 00:00:00 2001 From: wbaumann Date: Sun, 11 Mar 2012 15:40:32 +0000 Subject: [PATCH] Fix integer overrun --- ChangeLog | 4 ++++ NEWS | 2 +- src/cache.c | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 443f0f0..1c8e24e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ ChangeLog for davfs2 -------------------- +2012-03-1 Werner Baumann (werner.baumann@onlinehome.de) + * webdav.c, dav_init_cache: + Fix integer overrun. + 2012-02-05 Werner Baumann (werner.baumann@onlinehome.de) * mount_davfs.c, mount_davfs.h, webdav.c: Read client certificates in mount_davfs.c. diff --git a/NEWS b/NEWS index e6e84b1..b8772a4 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,7 @@ some other system than standard GNU/Linux and encouter problems please file an support request. Many of these problem should be sovable by importing additional Gnulib modules. -No longer check for somone esles home directory. +No longer check for somone elses home directory. TODO diff --git a/src/cache.c b/src/cache.c index b599a56..d93a98d 100644 --- a/src/cache.c +++ b/src/cache.c @@ -202,10 +202,10 @@ static char *cache_dir; /* Maximum cache size. If open files require more space, this will be ignored. */ -unsigned long long max_cache_size; +static unsigned long long max_cache_size; /* Actual cache size. */ -unsigned long long cache_size; +static unsigned long long cache_size; /* Alignment boundary of dav_node in byte. Used to compute a hash value and file numbers from node pointers. */ @@ -633,7 +633,7 @@ dav_init_cache(const dav_args *args, const char *mpoint) if (debug) syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Checking cache directory"); - max_cache_size = args->cache_size * 0x100000; + max_cache_size = (unsigned long long) args->cache_size * 0x100000; check_cache_dir(args->cache_dir, args->host, args->path, mpoint); if (debug) syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), " %s", cache_dir);