From: Timo Sirainen Date: Fri, 27 Jun 2014 14:37:56 +0000 (+0300) Subject: auth: Added assert to make sure sysconf() returns what we expect. X-Git-Tag: 2.2.14.rc1~334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bb7d8563b54cc71001c84b392ddfa4feffff4ce;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/auth/userdb-nss.c b/src/auth/userdb-nss.c index 24de11d2ec..2ab502477c 100644 --- a/src/auth/userdb-nss.c +++ b/src/auth/userdb-nss.c @@ -104,9 +104,13 @@ userdb_nss_preinit(pool_t pool, const char *args) { 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;