(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/fts-squat/squat-trie.c) |
| |
| 1609 | | | static int squat_trie_write(struct squat_trie_build_context *ctx) |
| 1610 | | | { |
| 1611 | | | struct squat_trie *trie = ctx->trie; |
| 1612 | | | struct file_lock *file_lock = NULL; |
| 1613 | | | struct ostream *output; |
| 1614 | | | const char *path; |
| 1615 | | | int fd = -1, ret = 0; |
| 1616 | | | |
| 1617 | | | if ((trie->hdr.used_file_size > sizeof(trie->hdr) && |
Event 1:
Taking true branch. - trie->hdr.used_file_size > sizeof( trie->hdr ) evaluates to false.
- 1 evaluates to true.
hide
|
|
| 1618 | | | trie->unmapped_child_count < trie->hdr.node_count/4) || 1) { |
| 1619 | | | |
| 1620 | | | ctx->compress_nodes = TRUE; |
Event 2:
!0 evaluates to true.
hide
|
|
| 1621 | | | |
| 1622 | [+] | | path = t_strconcat(trie->path, ".tmp", NULL); |
 |
| 1623 | [+] | | fd = squat_trie_create_fd(trie, path, O_TRUNC);
x /usr/include/bits/fcntl.h |
| |
41 | #define O_TRUNC 01000 /* not fcntl */ |
| |
|
 |
| 1624 | | | if (fd == -1) |
Event 12:
Skipping " if". fd == -1 evaluates to false.
hide
|
|
| 1625 | | | return -1; |
| 1626 | | | |
| 1627 | | | if (trie->lock_method != FILE_LOCK_METHOD_DOTLOCK) { |
Event 13:
Taking true branch. trie->lock_method != FILE_LOCK_METHOD_DOTLOCK evaluates to true.
hide
|
|
| 1628 | | | ret = file_wait_lock(fd, path, F_WRLCK,
x /usr/include/bits/fcntl.h |
| |
133 | #define F_WRLCK 1 /* Write lock. */ |
| |
|
Event 14:
path, which evaluates to NULL, is passed to file_wait_lock() as the second argument. See related event 8.
hide
|
|
| 1629 | | | trie->lock_method, |
| 1630 | | | SQUAT_TRIE_LOCK_TIMEOUT, |
| 1631 | [+] | | &file_lock); |
 |
| |