(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-cache-sync-update.c) |
| |
| 42 | | | static int mail_cache_handler_lock(struct mail_cache_sync_context *ctx, |
| 43 | | | struct mail_cache *cache) |
| 44 | | | { |
| 45 | | | int ret; |
| 46 | | | |
| 47 | | | if (ctx->locked) |
| 48 | | | return MAIL_CACHE_IS_UNUSABLE(cache) ? 0 : 1; |
| 49 | | | if (ctx->lock_failed) |
| 50 | | | return 0; |
| 51 | | | |
| 52 | | | if (!ctx->locked) { |
Redundant Condition
ctx->locked always evaluates to false. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that ctx->locked cannot be true.
- A crashing bug occurs on every path where ctx->locked could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 53 | | | if ((ret = mail_cache_lock(cache, TRUE)) <= 0) { |
| 54 | | | ctx->lock_failed = TRUE; |
| 55 | | | return ret; |
| 56 | | | } |
| 57 | | | ctx->locked = TRUE; |
| 58 | | | } |
| 59 | | | return 1; |
| 60 | | | } |
| |