(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/ssl-init.c) |
| |
| 83 | | | static bool check_parameters_file_set(struct settings *set) |
| 84 | | | { |
| 85 | | | const char *path; |
| 86 | | | struct stat st, st2; |
| 87 | | | time_t regen_time; |
| 88 | | | |
| 89 | | | if (strcmp(set->ssl, "no") == 0) |
Event 1:
Skipping " if". strcmp(set->ssl, "no") == 0 evaluates to false.
hide
|
|
| 90 | | | return TRUE; |
| 91 | | | |
| 92 | [+] | | path = t_strconcat(set->login_dir, "/"SSL_PARAMETERS_FILENAME, NULL); |
 |
| 93 | | | if (stat(path, &st) < 0) { |
Event 34:
path, which evaluates to the value assigned to ret at data-stack.c:335, is passed to stat64() as the first argument. See related event 33.
hide
Event 35:
stat64() accesses the file named path, where path is the value assigned to ret at data-stack.c:335. - The same name is used to access a file later, but it is not safe to assume that it will be the same underlying file.
See related event 34.
hide
Event 36:
Taking false branch. stat(path, &st) < 0 evaluates to false.
hide
|
|
| 94 | | | if (errno != ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
| 95 | | | i_error("stat() failed for SSL parameters file %s: %m", |
| 96 | | | path); |
| 97 | | | return TRUE; |
| 98 | | | } |
| 99 | | | |
| 100 | | | st.st_mtime = 0;
x /usr/include/bits/stat.h |
| |
95 | # define st_mtime st_mtim.tv_sec |
| |
|
| 101 | | | } else if (st.st_size == 0) { |
Event 37:
Taking true branch. st.st_size == 0 evaluates to true.
hide
|
|
| 102 | | | |
| 103 | | | st.st_mtime = 0;
x /usr/include/bits/stat.h |
| |
95 | # define st_mtime st_mtim.tv_sec |
| |
|
| 104 | | | (void)unlink(path); |
Event 38:
path, which evaluates to the value assigned to ret at data-stack.c:335, is passed to unlink(). See related event 33.
hide
File System Race Condition
The file named path is accessed again. Another process may have changed the file since the access at ssl-init.c:93. For example, an attacker could replace the original file with a link to a file containing important or confidential data. The issue can occur if the highlighted code executes. See related events 35 and 38. Show: All events | Only primary events |
|
| |