(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/cmd-select.c) |
| |
| 216 | | | static int select_qresync(struct imap_select_context *ctx) |
| 217 | | | { |
| 218 | | | struct imap_fetch_context *fetch_ctx; |
| 219 | | | struct mail_search_args *search_args; |
| 220 | | | |
| 221 | | | search_args = mail_search_build_init(); |
| 222 | | | search_args->args = p_new(search_args->pool, struct mail_search_arg, 1);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool.h |
| |
84 | #define p_new(pool, type, count) \ |
85 | ((type *) p_malloc(pool, sizeof(type) * (count))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool.h |
| |
87 | #define p_malloc(pool, size) (pool)->v->malloc(pool, size) |
| |
|
| 223 | | | search_args->args->type = SEARCH_UIDSET; |
| 224 | | | search_args->args->value.seqset = ctx->qresync_known_uids; |
| 225 | | | |
| 226 | | | fetch_ctx = imap_fetch_init(ctx->cmd, ctx->box); |
| 227 | | | if (fetch_ctx == NULL) |
Redundant Condition
fetch_ctx == (void *)0 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 fetch_ctx == (void *)0 cannot be true.
- A crashing bug occurs on every path where fetch_ctx == (void *)0 could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 228 | | | return -1; |
| 229 | | | |
| 230 | | | fetch_ctx->search_args = search_args; |
| 231 | | | fetch_ctx->send_vanished = TRUE; |
| 232 | | | fetch_ctx->qresync_sample_seqset = &ctx->qresync_sample_seqset; |
| 233 | | | fetch_ctx->qresync_sample_uidset = &ctx->qresync_sample_uidset; |
| 234 | | | |
| 235 | | | if (!imap_fetch_add_changed_since(fetch_ctx, ctx->qresync_modseq) || |
| 236 | | | !imap_fetch_init_handler(fetch_ctx, "UID", NULL) || |
| 237 | | | !imap_fetch_init_handler(fetch_ctx, "FLAGS", NULL) || |
| 238 | | | !imap_fetch_init_handler(fetch_ctx, "MODSEQ", NULL)) { |
| 239 | | | (void)imap_fetch_deinit(fetch_ctx); |
| 240 | | | return -1; |
| 241 | | | } |
| 242 | | | |
| 243 | | | if (imap_fetch_begin(fetch_ctx) == 0) { |
| 244 | | | if (imap_fetch_more(fetch_ctx) == 0) { |
| 245 | | | |
| 246 | | | ctx->fetch_ctx = fetch_ctx; |
| 247 | | | ctx->cmd->state = CLIENT_COMMAND_STATE_WAIT_OUTPUT; |
| 248 | | | |
| 249 | | | ctx->cmd->func = cmd_select_continue; |
| 250 | | | ctx->cmd->context = ctx; |
| 251 | | | return FALSE; |
| 252 | | | } |
| 253 | | | } |
| 254 | | | |
| 255 | | | return imap_fetch_deinit(fetch_ctx); |
| 256 | | | } |
| |