dovecot-2.2-pigeonhole: lib-sieve: util: realpath: Make Coverity...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Fri Jan 8 16:26:16 UTC 2016


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/6ddf62b87f60
changeset: 2205:6ddf62b87f60
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Thu Jan 07 22:20:21 2016 +0100
description:
lib-sieve: util: realpath: Make Coverity happier.

diffstat:

 src/lib-sieve/util/realpath.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 59a9b4f2d056 -r 6ddf62b87f60 src/lib-sieve/util/realpath.c
--- a/src/lib-sieve/util/realpath.c	Thu Jan 07 22:09:50 2016 +0100
+++ b/src/lib-sieve/util/realpath.c	Thu Jan 07 22:20:21 2016 +0100
@@ -144,8 +144,11 @@
 					/* attempt to read the link */
 					if ((ret=readlink(npath, npath_link, lsize)) < 0)
 						return -1;
-					if ((size_t)ret < lsize)
+					if ((size_t)ret < lsize) {
+						/* make static analyzers happy */
+						npath_link[ret] = '\0';
 						break;
+					}
 
 					/* sum of new symlink content length and path tail length may not
 					   exeed maximum */


More information about the dovecot-cvs mailing list