(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/fts-squat/squat-trie.c) |
| |
| 1480 | | | static int squat_trie_map(struct squat_trie *trie, bool building) |
| 1481 | | | { |
| 1482 | | | struct file_lock *file_lock = NULL; |
| 1483 | | | struct dotlock *dotlock = NULL; |
| 1484 | | | bool changed; |
| 1485 | | | int ret; |
| 1486 | | | |
| 1487 | | | if (trie->fd != -1) { |
Event 1:
Skipping " if". trie->fd != -1 evaluates to false.
hide
|
|
| 1488 | | | if (squat_trie_lock(trie, F_RDLCK, &file_lock, &dotlock) <= 0)
x /usr/include/bits/fcntl.h |
| |
132 | #define F_RDLCK 0 /* Read lock. */ |
| |
|
| 1489 | | | return -1; |
| 1490 | | | if ((trie->flags & SQUAT_INDEX_FLAG_MMAP_DISABLE) != 0 && |
| 1491 | | | trie->file_cache == NULL) |
| 1492 | | | trie->file_cache = file_cache_new(trie->fd); |
| 1493 | | | } |
| 1494 | | | |
| 1495 | [+] | | ret = (trie); |
 |
| 1496 | | | if (ret == 0) { |
Event 3:
Skipping " if". ret == 0 evaluates to false.
hide
|
|
| 1497 | | | if (file_lock != NULL) |
| 1498 | | | file_unlock(&file_lock); |
| 1499 | | | else |
| 1500 | | | file_dotlock_delete(&dotlock); |
| 1501 | | | squat_trie_delete(trie); |
| 1502 | | | squat_trie_close(trie); |
| 1503 | | | (trie); |
| 1504 | | | } |
| 1505 | | | changed = trie->root.children.offset != trie->hdr.root_offset; |
Event 4:
trie->root.children.offset != trie->hdr.root_offset evaluates to false.
hide
Event 5:
Considering the case where trie->root.children is equal to trie->hdr.root_offset so trie->hdr.root_offset must have been equal to trie->root.children.
hide
|
|
| 1506 | | | |
| 1507 | | | if (changed || trie->hdr.root_offset == 0) { |
Event 7:
Considering the case where trie->hdr.root_offset must have been equal to 0.
hide
Event 8:
Considering the case where trie->hdr.root_offset is equal to 0 so trie->root.children must have been equal to 0. See related events 5 and 7.
hide
|
|
| 1508 | [+] | | node_free(trie, &trie->root); |
Event 9:
&trie->root is passed to node_free() as the second argument. - Determines the freed value in the Free Null Pointer warning later.
hide
|
|
 |
| |