dovecot-2.2: auth: Added assert to make sure sysconf() returns w...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 27 14:39:31 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/1abf8621981a
changeset: 17536:1abf8621981a
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 27 17:37:56 2014 +0300
description:
auth: Added assert to make sure sysconf() returns what we expect.
userdb nss shouldn't even be used though. So this is mainly to silence
Coverity.

diffstat:

 src/auth/userdb-nss.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r 31efe2d04793 -r 1abf8621981a src/auth/userdb-nss.c
--- a/src/auth/userdb-nss.c	Fri Jun 27 16:29:18 2014 +0300
+++ b/src/auth/userdb-nss.c	Fri Jun 27 17:37:56 2014 +0300
@@ -104,9 +104,13 @@
 {
 	struct nss_userdb_module *module;
 	const char *const *tmp;
+	long bufsize;
+
+	bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+	i_assert(bufsize > 0);
 
 	module = p_new(pool, struct nss_userdb_module, 1);
-	module->bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+	module->bufsize = bufsize;
 	module->buf = p_malloc(pool, module->bufsize);
 	module->module.blocking = TRUE;
 


More information about the dovecot-cvs mailing list