From 461da9c990a6d84f02354cee32d4dd3e18ca5b1e Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Thu, 1 Feb 2018 18:21:24 +0100 Subject: [PATCH] lib-sieve: util: realpath: Fixed assertion in path_normalize(). The invariant was using the wrong variable for comparison, causing it to trigger erraticly. --- src/lib-sieve/util/realpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib-sieve/util/realpath.c b/src/lib-sieve/util/realpath.c index 85e35e0e6..aba126998 100644 --- a/src/lib-sieve/util/realpath.c +++ b/src/lib-sieve/util/realpath.c @@ -96,7 +96,7 @@ static int path_normalize(const char *path, bool resolve_links, } /* copy segment to normalized path */ - i_assert(p + seglen < npath + asize); + i_assert((npath_pos + seglen) < (npath + asize)); (void)memmove(npath_pos, p, seglen); npath_pos += seglen; }