(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log.c) |
| |
| 237 | | | int mail_transaction_log_rotate(struct mail_transaction_log *log, bool reset) |
| 238 | | | { |
| 239 | | | struct mail_transaction_log_file *file; |
| 240 | | | const char *path = log->head->filepath; |
| 241 | | | struct stat st; |
| 242 | | | |
| 243 | | | i_assert(log->head->locked);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
189 | #define i_assert(expr) STMT_START{ \ |
190 | if (unlikely(!(expr))) \ |
191 | i_panic("file %s: line %d (%s): assertion failed: (%s)", \ |
192 | __FILE__, \ |
193 | __LINE__, \ |
194 | __PRETTY_FUNCTION__, \ |
195 | #expr); }STMT_END |
| |
|
Event 1:
Skipping " if". !log->head->locked evaluates to false.
hide
Event 2:
Skipping " if". !!log->head->locked evaluates to true.
hide
Event 3:
Skipping " if". !!!log->head->locked evaluates to false.
hide
Event 4:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 244 | | | |
| 245 | | | if (MAIL_INDEX_IS_IN_MEMORY(log->index)) { |
Event 5:
Taking true branch. log->index->dir == (void *)0 evaluates to true.
hide
|
|
| 246 | [+] | | file = mail_transaction_log_file_alloc_in_memory(log); |
 |
| 247 | | | if (reset) { |
Event 8:
Skipping " if". reset evaluates to false.
hide
|
|
| 248 | | | file->hdr.prev_file_seq = 0; |
| 249 | | | file->hdr.prev_file_offset = 0; |
| 250 | | | } |
| 251 | | | } else { |
| 252 | | | |
| 253 | | | |
| 254 | | | if (fstat(log->head->fd, &st) < 0) { |
| 255 | | | mail_index_file_set_syscall_error(log->index, |
| 256 | | | file->filepath, "fstat()"); |
| 257 | | | return -1; |
| 258 | | | } |
| 259 | | | |
| 260 | | | file = mail_transaction_log_file_alloc(log, path); |
| 261 | | | |
| 262 | | | file->st_dev = st.st_dev; |
| 263 | | | file->st_ino = st.st_ino; |
| 264 | | | file->last_mtime = st.st_mtime;
x /usr/include/bits/stat.h |
| |
95 | # define st_mtime st_mtim.tv_sec |
| |
|
| 265 | | | file->last_size = st.st_size; |
| 266 | | | |
| 267 | | | if (mail_transaction_log_file_create(file, reset) < 0) { |
| 268 | | | mail_transaction_log_file_free(&file); |
| 269 | | | return -1; |
| 270 | | | } |
| 271 | | | } |
| 272 | | | |
| 273 | | | if (--log->head->refcount == 0) |
Event 9:
Taking true branch. --log->head->refcount == 0 evaluates to true.
hide
|
|
| 274 | [+] | | mail_transaction_logs_clean(log); |
Event 10:
log is passed to mail_transaction_logs_clean().
hide
|
|
 |
| 275 | | | else |
| 276 | | | mail_transaction_log_file_unlock(log->head); |
| 277 | [+] | | mail_transaction_log_set_head(log, file); |
Event 37:
log is passed to mail_transaction_log_set_head() as the first argument.
hide
|
|
 |
| |