(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-strmap.c) |
| |
| 814 | | | static void mail_index_strmap_view_renumber(struct mail_index_strmap_view *view) |
| 815 | | | { |
| 816 | | | struct mail_index_strmap_read_context ctx; |
| 817 | | | struct mail_index_strmap_rec *recs, *hash_rec; |
| 818 | | | uint32_t prev_uid, str_idx, *recs_crc32, *renumber_map; |
| 819 | | | unsigned int i, dest, count, count2; |
| 820 | | | int ret; |
| 821 | | | |
| 822 | | | memset(&ctx, 0, sizeof(ctx)); |
| 823 | | | ctx.view = view; |
| 824 | | | |
| 825 | | | |
| 826 | | | |
| 827 | [+] | | renumber_map = i_new(uint32_t, view->next_str_idx);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.h |
| |
8 | #define i_new(type, count) ((type *) i_malloc(sizeof(type) * (count))) |
| |
|
 |
| 828 | | | str_idx = 0; prev_uid = 0; |
| 829 | [+] | | recs = array_get_modifiable(&view->recs, &count);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
174 | #define array_get_modifiable(array, count) \ |
175 | ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
176 | array_get_modifiable_i(&(array)->arr, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
45 | # define ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
46 | (typeof(*(array)->v_modifiable)) |
| |
|
 |
| 830 | | | recs_crc32 = array_get_modifiable(&view->recs_crc32, &count2);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
174 | #define array_get_modifiable(array, count) \ |
175 | ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
176 | array_get_modifiable_i(&(array)->arr, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
45 | # define ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
46 | (typeof(*(array)->v_modifiable)) |
| |
|
| 831 | | | i_assert(count == count2);
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 7:
Skipping " if". count == count2 evaluates to true.
hide
Event 8:
Skipping " if". !(count == count2) evaluates to false.
hide
Event 9:
Skipping " if". !!(count == count2) evaluates to true.
hide
Event 10:
Skipping " if". !!!(count == count2) evaluates to false.
hide
Event 11:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 832 | | | |
| 833 | | | for (i = dest = 0; i < count; ) { |
Event 12:
Entering loop body. i < count evaluates to true.
hide
|
|
| 834 | | | if (prev_uid != recs[i].uid) { |
Event 13:
Skipping " if". prev_uid != recs[i].uid evaluates to false.
hide
|
|
| 835 | | | |
| 836 | | | prev_uid = recs[i].uid; |
| 837 | | | ret = mail_index_strmap_uid_exists(&ctx, prev_uid); |
| 838 | | | i_assert(ret >= 0);
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 |
| |
|
| 839 | | | if (ret == 0) { |
| 840 | | | |
| 841 | | | do { |
| 842 | | | i++; |
| 843 | | | } while (i < count && recs[i].uid == prev_uid); |
| 844 | | | continue; |
| 845 | | | } |
| 846 | | | } |
| 847 | | | |
| 848 | | | i_assert(recs[i].str_idx < view->next_str_idx);
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 14:
Skipping " if". recs[i].str_idx < view->next_str_idx evaluates to true.
hide
Event 15:
Skipping " if". !(recs[i].str_idx < view->next_str_idx) evaluates to false.
hide
Event 16:
Skipping " if". !!(recs[i].str_idx < view->next_str_idx) evaluates to true.
hide
Event 17:
Skipping " if". !!!(recs[i].str_idx < view->next_str_idx) evaluates to false.
hide
Event 18:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 849 | | | if (renumber_map[recs[i].str_idx] == 0) |
Uninitialized Variable
*renumber_map was not initialized. The issue can occur if the highlighted code executes. See related events 2 and 6. Show: All events | Only primary events |
|
| |