]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: path-util: Fixed assertion in path_normalize().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 30 Jan 2017 22:20:48 +0000 (23:20 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 30 Jan 2017 22:20:48 +0000 (23:20 +0100)
The invariant was using the wrong variable for comparison, causing it to trigger erraticly.

src/lib/path-util.c

index 555194b2344c563d296bec86600db55c6b563d4c..4d0188e5a12bda1ac0bd8d689cf1138a805229a2 100644 (file)
@@ -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;
                }