(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log-append.c) |
| |
| 492 | | | log_append_keyword_updates(struct log_append_context *ctx) |
| 493 | | | { |
| 494 | | | const struct mail_index_transaction_keyword_update *updates; |
| 495 | | | const char *const *keywords; |
| 496 | | | buffer_t *hdr_buf; |
| 497 | | | enum mail_index_sync_type change_mask = 0; |
| 498 | | | unsigned int i, count, keywords_count; |
| 499 | | | |
| 500 | | | hdr_buf = buffer_create_dynamic(pool_datastack_create(), 64); |
Ignored Return Value
The return value of buffer_create_dynamic() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of buffer_create_dynamic() is checked 98% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt buffer_create_dynamic() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 501 | | | |
| 502 | | | keywords = array_get_modifiable(&ctx->trans->view->index->keywords,
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)) |
| |
|
| 503 | | | &keywords_count); |
| 504 | | | updates = array_get_modifiable(&ctx->trans->keyword_updates, &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)) |
| |
|
| 505 | | | i_assert(count <= keywords_count);
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 2:
Skipping " if". count <= keywords_count evaluates to true.
hide
Event 3:
Skipping " if". !(count <= keywords_count) evaluates to false.
hide
Event 4:
Skipping " if". !!(count <= keywords_count) evaluates to true.
hide
Event 5:
Skipping " if". !!!(count <= keywords_count) evaluates to false.
hide
Event 6:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 506 | | | |
| 507 | | | for (i = 0; i < count; i++) { |
| 508 | | | if (array_is_created(&updates[i].add_seq)) {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
91 | #define array_is_created(array) \ |
92 | array_is_created_i(&(array)->arr) |
| |
|
| 509 | | | change_mask |= MAIL_INDEX_SYNC_TYPE_KEYWORD_ADD; |
| 510 | | | log_append_keyword_update(ctx, hdr_buf, |
| 511 | | | MODIFY_ADD, keywords[i], |
| 512 | | | updates[i].add_seq.arr.buffer); |
| 513 | | | } |
| 514 | | | if (array_is_created(&updates[i].remove_seq)) {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
91 | #define array_is_created(array) \ |
92 | array_is_created_i(&(array)->arr) |
| |
|
| 515 | | | change_mask |= MAIL_INDEX_SYNC_TYPE_KEYWORD_REMOVE; |
| 516 | | | log_append_keyword_update(ctx, hdr_buf, |
| 517 | | | MODIFY_REMOVE, keywords[i], |
| 518 | | | updates[i].remove_seq.arr.buffer); |
| 519 | | | } |
| 520 | | | } |
| 521 | | | return change_mask; |
| 522 | | | } |
| |