From: Stephan Bosch Date: Mon, 30 Jan 2017 22:20:48 +0000 (+0100) Subject: lib: path-util: Fixed assertion in path_normalize(). X-Git-Tag: 2.3.0.rc1~2206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c7b2d544bb9a3ad7a306b21ad014e5b85dbcd83;p=thirdparty%2Fdovecot%2Fcore.git lib: path-util: Fixed assertion in path_normalize(). The invariant was using the wrong variable for comparison, causing it to trigger erraticly. --- diff --git a/src/lib/path-util.c b/src/lib/path-util.c index 555194b234..4d0188e5a1 100644 --- a/src/lib/path-util.c +++ b/src/lib/path-util.c @@ -102,7 +102,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; }