(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/userdb-nss.c) |
| |
| 103 | | | static struct userdb_module * |
| 104 | | | userdb_nss_preinit(struct auth_userdb *auth_userdb, const char *args) |
| 105 | | | { |
| 106 | | | struct nss_userdb_module *module; |
| 107 | | | const char *const *tmp; |
| 108 | | | pool_t pool = auth_userdb->auth->pool; |
| 109 | | | |
| 110 | | | module = p_new(pool, struct nss_userdb_module, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool.h |
| |
84 | #define p_new(pool, type, count) \ |
85 | ((type *) p_malloc(pool, sizeof(type) * (count))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool.h |
| |
87 | #define p_malloc(pool, size) (pool)->v->malloc(pool, size) |
| |
|
| 111 | | | module->bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
x /usr/include/bits/confname.h |
| |
226 | #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX |
| |
|
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 112 | | | module->buf = p_malloc(pool, module->bufsize);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool.h |
| |
87 | #define p_malloc(pool, size) (pool)->v->malloc(pool, size) |
| |
|
| 113 | | | |
| 114 | | | for (tmp = t_strsplit(args, " "); *tmp != NULL; tmp++) { |
| 115 | | | if (strcmp(*tmp, "blocking=yes") == 0) |
| 116 | | | module->module.blocking = TRUE; |
| 117 | | | else if (strncmp(*tmp, "service=", 8) == 0) |
| 118 | | | module->nss_module.name = p_strdup(pool, *tmp + 8); |
| 119 | | | else |
| 120 | | | i_fatal("userdb nss: Unknown setting: %s", *tmp); |
| 121 | | | } |
| 122 | | | |
| 123 | | | if (module->nss_module.name == NULL) |
| 124 | | | i_fatal("userdb nss: Missing service"); |
| 125 | | | userdb_nss_load_module(module, pool); |
| 126 | | | |
| 127 | | | module->module.cache_key = USER_CACHE_KEY; |
| 128 | | | return &module->module; |
| 129 | | | } |
| |