(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/master-settings.c) |
| |
| 1220 | | | static const char *parse_setting(const char *key, const char *value, |
| 1221 | | | struct settings_parse_ctx *ctx) |
| 1222 | | | { |
| 1223 | | | const char *error; |
| 1224 | | | |
| 1225 | | | switch (ctx->type) { |
| 1226 | | | case SETTINGS_TYPE_ROOT: |
| 1227 | | | case SETTINGS_TYPE_SERVER: |
| 1228 | | | error = NULL; |
| 1229 | | | if (ctx->protocol == MAIL_PROTOCOL_ANY || |
| 1230 | | | ctx->protocol == MAIL_PROTOCOL_IMAP) { |
| 1231 | | | error = parse_setting_from_defs(settings_pool, |
| 1232 | | | setting_defs, |
| 1233 | | | ctx->server->imap, |
| 1234 | | | key, value); |
| 1235 | | | } |
| 1236 | | | |
| 1237 | | | if (error == NULL && |
| 1238 | | | (ctx->protocol == MAIL_PROTOCOL_ANY || |
| 1239 | | | ctx->protocol == MAIL_PROTOCOL_POP3)) { |
| 1240 | | | error = parse_setting_from_defs(settings_pool, |
| 1241 | | | setting_defs, |
| 1242 | | | ctx->server->pop3, |
| 1243 | | | key, value); |
| 1244 | | | } |
| 1245 | | | |
| 1246 | | | if (error == NULL) |
| 1247 | | | return NULL; |
| 1248 | | | |
| 1249 | | | if (strncmp(key, "auth_", 5) == 0) { |
| 1250 | | | return parse_setting_from_defs(settings_pool, |
| 1251 | | | auth_setting_defs, |
| 1252 | | | ctx->auth, |
| 1253 | | | key + 5, value); |
| 1254 | | | } |
| 1255 | | | return error; |
| 1256 | | | case SETTINGS_TYPE_AUTH: |
| 1257 | | | if (strncmp(key, "auth_", 5) == 0) |
| 1258 | | | key += 5; |
| 1259 | | | return parse_setting_from_defs(settings_pool, auth_setting_defs, |
| 1260 | | | ctx->auth, key, value); |
| 1261 | | | case SETTINGS_TYPE_AUTH_SOCKET: |
| 1262 | | | return parse_setting_from_defs(settings_pool, |
| 1263 | | | auth_socket_setting_defs, |
| 1264 | | | ctx->auth_socket, key, value); |
| 1265 | | | case SETTINGS_TYPE_AUTH_PASSDB: |
| 1266 | | | return parse_setting_from_defs(settings_pool, |
| 1267 | | | auth_passdb_setting_defs, |
| 1268 | | | ctx->auth_passdb, key, value); |
| 1269 | | | case SETTINGS_TYPE_AUTH_USERDB: |
| 1270 | | | return parse_setting_from_defs(settings_pool, |
| 1271 | | | auth_userdb_setting_defs, |
| 1272 | | | ctx->auth_userdb, key, value); |
| 1273 | | | case SETTINGS_TYPE_NAMESPACE: |
| 1274 | | | return parse_setting_from_defs(settings_pool, |
| 1275 | | | namespace_setting_defs, |
| 1276 | | | ctx->namespace, key, value); |
| 1277 | | | case SETTINGS_TYPE_SOCKET: |
| 1278 | | | return parse_setting_from_defs(settings_pool, |
| 1279 | | | socket_setting_defs, |
| 1280 | | | ctx->socket, key, value); |
| 1281 | | | case SETTINGS_TYPE_DICT: |
| 1282 | | | key = p_strdup(settings_pool, key); |
| 1283 | | | value = p_strdup(settings_pool, value); |
| 1284 | | | |
| 1285 | | | array_append(&ctx->server->dicts, &key, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 1286 | | | array_append(&ctx->server->dicts, &value, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 1287 | | | return NULL; |
| 1288 | | | case SETTINGS_TYPE_PLUGIN: |
| 1289 | | | key = p_strdup(settings_pool, key); |
Ignored Return Value
The return value of p_strdup() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of p_strdup() is checked 98% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt p_strdup() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 1290 | | | value = p_strdup(settings_pool, value); |
| 1291 | | | |
| 1292 | | | if (ctx->protocol == MAIL_PROTOCOL_ANY || |
Event 2:
Skipping " if". - ctx->protocol == MAIL_PROTOCOL_ANY evaluates to false.
- ctx->protocol == MAIL_PROTOCOL_IMAP evaluates to false.
hide
|
|
| 1293 | | | ctx->protocol == MAIL_PROTOCOL_IMAP) { |
| 1294 | | | array_append(&ctx->server->imap->plugin_envs, &key, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 1295 | | | array_append(&ctx->server->imap->plugin_envs,
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 1296 | | | &value, 1); |
| 1297 | | | } |
| 1298 | | | if (ctx->protocol == MAIL_PROTOCOL_ANY || |
Event 3:
Skipping " if". - ctx->protocol == MAIL_PROTOCOL_ANY evaluates to false.
- ctx->protocol == MAIL_PROTOCOL_POP3 evaluates to false.
hide
|
|
| 1299 | | | ctx->protocol == MAIL_PROTOCOL_POP3) { |
| 1300 | | | array_append(&ctx->server->pop3->plugin_envs, &key, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 1301 | | | array_append(&ctx->server->pop3->plugin_envs,
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 1302 | | | &value, 1); |
| 1303 | | | } |
| 1304 | | | return NULL; |
| 1305 | | | } |
| 1306 | | | |
| 1307 | | | i_unreached();
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
208 | #define i_unreached() \ |
209 | i_panic("file %s: line %d: unreached", __FILE__, __LINE__) |
| |
|
| 1308 | | | } |
| |