(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/deliver/deliver.c) |
| |
| 327 | | | static void config_file_init(const char *path) |
| 328 | | | { |
| 329 | | | struct istream *input; |
| 330 | | | const char *key, *value, *str, *ukey; |
| 331 | | | char *line, *p, quote; |
| 332 | | | int fd, sections = 0; |
| 333 | | | bool lda_section = FALSE, pop3_section = FALSE, plugin_section = FALSE; |
| 334 | | | bool ns_section = FALSE, ns_location = FALSE, ns_list = FALSE; |
| 335 | | | bool ns_subscriptions = FALSE; |
| 336 | | | unsigned int i, ns_idx = 0; |
| 337 | | | size_t len; |
| 338 | | | |
| 339 | | | plugin_pool = pool_alloconly_create("Plugin strings", 512); |
| 340 | | | i_array_init(&lda_envs, 16);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
37 | #define i_array_init(array, init_count) \ |
38 | p_array_init(array, default_pool, init_count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
35 | #define p_array_init(array, pool, init_count) \ |
36 | array_create(array, pool, sizeof(**(array)->v), init_count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
75 | #define array_create(array, pool, element_size, init_count) \ |
76 | array_create_i(&(array)->arr, pool, element_size, init_count) |
| |
|
| 341 | | | i_array_init(&plugin_envs, 16);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
37 | #define i_array_init(array, init_count) \ |
38 | p_array_init(array, default_pool, init_count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
35 | #define p_array_init(array, pool, init_count) \ |
36 | array_create(array, pool, sizeof(**(array)->v), init_count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
75 | #define array_create(array, pool, element_size, init_count) \ |
76 | array_create_i(&(array)->arr, pool, element_size, init_count) |
| |
|
| 342 | | | |
| 343 | | | fd = open(path, O_RDONLY); |
| 344 | | | if (fd < 0) |
Event 2:
Skipping " if". fd < 0 evaluates to false.
hide
|
|
| 345 | | | i_fatal_status(EX_CONFIG, "open(%s) failed: %m", path);
x /usr/include/sysexits.h |
| |
110 | #define EX_CONFIG 78 /* configuration error */ |
| |
|
| 346 | | | |
| 347 | | | input = i_stream_create_fd(fd, 1024, TRUE); |
Event 3:
!0 evaluates to true.
hide
|
|
| 348 | | | i_stream_set_return_partial_line(input, TRUE); |
Event 4:
!0 evaluates to true.
hide
|
|
| 349 | [+] | | while ((line = i_stream_read_next_line(input)) != NULL) { |
 |
| 350 | | | |
| 351 | | | |
| 352 | | | |
| 353 | | | while (IS_WHITE(*line)) |
| 354 | | | line++; |
| 355 | | | |
| 356 | | | |
| 357 | | | if (*line == '#' || *line == '\0') |
Event 21:
Skipping " if". - *line == 35 evaluates to false.
- *line == 0 evaluates to false.
hide
|
|
| 358 | | | continue; |
| 359 | | | |
| 360 | | | |
| 361 | | | for (p = line; *p != '\0'; p++) { |
| 362 | | | if (*p == '\'' || *p == '"') { |
| 363 | | | quote = *p; |
| 364 | | | for (p++; *p != quote && *p != '\0'; p++) { |
| 365 | | | if (*p == '\\' && p[1] != '\0') |
| 366 | | | p++; |
| 367 | | | } |
| 368 | | | if (*p == '\0') |
| 369 | | | break; |
| 370 | | | } else if (*p == '#') { |
| 371 | | | *p = '\0'; |
| 372 | | | break; |
| 373 | | | } |
| 374 | | | } |
| 375 | | | |
| 376 | | | |
| 377 | | | len = strlen(line); |
| 378 | | | while (IS_WHITE(line[len-1])) |
| 379 | | | len--; |
| 380 | | | line[len] = '\0'; |
| 381 | | | |
| 382 | | | if (strncmp(line, "!include_try ", 13) == 0) |
Event 24:
Skipping " if". strncmp(...) == 0 evaluates to false.
hide
|
|
| 383 | | | continue; |
| 384 | | | if (strncmp(line, "!include ", 9) == 0) { |
Event 25:
Skipping " if". strncmp(...) == 0 evaluates to false.
hide
|
|
| 385 | | | i_fatal_status(EX_CONFIG, "Error in config file %s: "
x /usr/include/sysexits.h |
| |
110 | #define EX_CONFIG 78 /* configuration error */ |
| |
|
| 386 | | | "deliver doesn't support !include directive", path); |
| 387 | | | } |
| 388 | | | |
| 389 | | | value = p = strchr(line, '='); |
| 390 | | | if (value == NULL) { |
Event 26:
Taking true branch. value == (void *)0 evaluates to true.
hide
|
|
| 391 | | | if (strchr(line, '{') != NULL) { |
Event 27:
Taking true branch. strchr(line, 123) != (void *)0 evaluates to true.
hide
|
|
| 392 | | | if (strcmp(line, "protocol lda {") == 0) |
Event 28:
Taking false branch. strcmp(...) == 0 evaluates to false.
hide
|
|
| 393 | | | lda_section = TRUE; |
| 394 | | | else if (strcmp(line, "plugin {") == 0) |
Event 29:
Taking false branch. strcmp(line, "plugin {") == 0 evaluates to false.
hide
|
|
| 395 | | | plugin_section = TRUE; |
| 396 | | | else if (strcmp(line, "protocol pop3 {") == 0) |
Event 30:
Taking false branch. strcmp(...) == 0 evaluates to false.
hide
|
|
| 397 | | | pop3_section = TRUE; |
| 398 | | | else if (strncmp(line, "namespace ", 10) == 0) { |
Event 31:
Taking true branch. strncmp(...) == 0 evaluates to true.
hide
|
|
| 399 | | | ns_section = TRUE; |
Event 32:
!0 evaluates to true.
hide
|
|
| 400 | | | ns_idx++; |
| 401 | | | line += 10; |
| 402 | | | env_put(t_strdup_printf( |
| 403 | | | "NAMESPACE_%u_TYPE=%s", ns_idx, |
| 404 | [+][+] | | t_strcut(line, ' '))); |
 |
 |
| |