Skip to content

Commit

Permalink
lib-sieve: util: realpath: Implicitly ignore memmove and memcpy retur…
Browse files Browse the repository at this point in the history
…n values in path-util.

This is because dovecot code doesn't explicitly ignore the return values
of those functions elsewhere either.
  • Loading branch information
stephanbosch committed Feb 5, 2018
1 parent 461da9c commit c6aa646
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib-sieve/util/realpath.c
Expand Up @@ -97,7 +97,7 @@ static int path_normalize(const char *path, bool resolve_links,

/* copy segment to normalized path */
i_assert((npath_pos + seglen) < (npath + asize));
(void)memmove(npath_pos, p, seglen);
memmove(npath_pos, p, seglen);
npath_pos += seglen;
}

Expand Down Expand Up @@ -137,7 +137,7 @@ static int path_normalize(const char *path, bool resolve_links,

if (ltlen > 0) {
/* preserve tail just after end of npath */
(void)memmove(npath_pos + 1, segend, ltlen);
memmove(npath_pos + 1, segend, ltlen);
}

/* read the symlink after the preserved tail */
Expand Down Expand Up @@ -176,10 +176,10 @@ static int path_normalize(const char *path, bool resolve_links,
/* add tail of previous path at end of symlink */
if (ltlen > 0) {
i_assert(npath_pos + 1 + tlen < npath + asize);
(void)memcpy(npath_link + ret, npath_pos + 1, tlen);
memcpy(npath_link + ret, npath_pos + 1, tlen);
} else {
i_assert(segend + tlen < npath + asize);
(void)memcpy(npath_link + ret, segend, tlen);
memcpy(npath_link + ret, segend, tlen);
}
*(npath_link+ret+tlen) = '\0';

Expand Down

0 comments on commit c6aa646

Please sign in to comment.