[TS-1648] Segmentation fault in dir_clear_range()
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fed6a5b8 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fed6a5b8 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fed6a5b8 Branch: refs/heads/5.0.x Commit: fed6a5b8e622303a2528dba64869aac6bfe9e28b Parents: 4c68459 Author: Brian Geffon <[email protected]> Authored: Thu Jan 16 15:38:15 2014 -0800 Committer: Brian Geffon <[email protected]> Committed: Thu Jan 16 15:38:15 2014 -0800 ---------------------------------------------------------------------- CHANGES | 2 ++ iocore/cache/CacheDir.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fed6a5b8/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 221ebf2..8929fbd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 4.2.0 + *) [TS-1648] Segmentation fault in dir_clear_range() + *) [TS-2500] Fix handling of cache stripe assignment when a disk is taken offline. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fed6a5b8/iocore/cache/CacheDir.cc ---------------------------------------------------------------------- diff --git a/iocore/cache/CacheDir.cc b/iocore/cache/CacheDir.cc index e00930e..f1ba72c 100644 --- a/iocore/cache/CacheDir.cc +++ b/iocore/cache/CacheDir.cc @@ -466,7 +466,7 @@ dir_clean_range_interimvol(off_t start, off_t end, InterimCacheVol *svol) void dir_clear_range(off_t start, off_t end, Vol *vol) { - for (int i = 0; i < vol->buckets * DIR_DEPTH * vol->segments; i++) { + for (int64_t i = 0; i < (int64_t)(vol->buckets * DIR_DEPTH * vol->segments); i++) { Dir *e = dir_index(vol, i); if (!dir_token(e) && dir_offset(e) >= (int64_t)start && dir_offset(e) < (int64_t)end) { CACHE_DEC_DIR_USED(vol->mutex);
