(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-sync.c) |
| |
| 786 | | | bool mail_index_sync_keywords_apply(const struct mail_index_sync_rec *sync_rec, |
| 787 | | | ARRAY_TYPE(keyword_indexes) *keywords) |
| 788 | | | { |
| 789 | | | const unsigned int *keyword_indexes; |
| 790 | | | unsigned int idx = sync_rec->keyword_idx; |
| 791 | | | unsigned int i, count; |
| 792 | | | |
| 793 | | | keyword_indexes = array_get(keywords, &count);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
156 | #define array_get(array, count) \ |
157 | ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
43 | # define ARRAY_TYPE_CAST_CONST(array) \ |
44 | (typeof(*(array)->v)) |
| |
|
| 794 | | | switch (sync_rec->type) { |
| 795 | | | case MAIL_INDEX_SYNC_TYPE_KEYWORD_ADD: |
| 796 | | | for (i = 0; i < count; i++) { |
| 797 | | | if (keyword_indexes[i] == idx) |
| 798 | | | return FALSE; |
| 799 | | | } |
| 800 | | | |
| 801 | | | array_append(keywords, &idx, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
116 | #define array_append(array, data, count) \ |
117 | array_append_i(&(array)->arr + ARRAY_TYPE_CHECK(array, data), \ |
118 | data, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
47 | # define ARRAY_TYPE_CHECK(array, data) \ |
48 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \ |
49 | **(array)->v_modifiable, *data) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 802 | | | return TRUE; |
| 803 | | | case MAIL_INDEX_SYNC_TYPE_KEYWORD_REMOVE: |
| 804 | | | for (i = 0; i < count; i++) { |
| 805 | | | if (keyword_indexes[i] == idx) { |
| 806 | | | array_delete(keywords, i, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
147 | #define array_delete(array, idx, count) \ |
148 | array_delete_i(&(array)->arr, idx, count) |
| |
|
| 807 | | | return TRUE; |
| 808 | | | } |
| 809 | | | } |
| 810 | | | return FALSE; |
| 811 | | | case MAIL_INDEX_SYNC_TYPE_KEYWORD_RESET: |
| 812 | | | if (array_count(keywords) == 0) |
| 813 | | | return FALSE; |
| 814 | | | |
| 815 | | | array_clear(keywords); |
| 816 | | | return TRUE; |
| 817 | | | default: |
| 818 | | | i_unreached();
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
208 | #define i_unreached() \ |
209 | i_panic("file %s: line %d: unreached", __FILE__, __LINE__) |
| |
|
| 819 | | | return FALSE; |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. |
|
| 820 | | | } |
| 821 | | | } |
| |