(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/imap-fetch-body.c) |
| |
| 247 | | | static int fetch_stream_send_direct(struct imap_fetch_context *ctx) |
| 248 | | | { |
| 249 | | | off_t ret; |
| 250 | | | |
| 251 | | | o_stream_set_max_buffer_size(ctx->client->output, 0); |
| 252 | | | ret = o_stream_send_istream(ctx->client->output, ctx->cur_input); |
| 253 | | | o_stream_set_max_buffer_size(ctx->client->output, (size_t)-1); |
| 254 | | | |
| 255 | | | if (ret < 0) |
| 256 | | | return -1; |
| 257 | | | |
| 258 | | | ctx->cur_offset += ret; |
| 259 | | | |
| 260 | | | if (ctx->cur_append_eoh && ctx->cur_offset + 2 == ctx->cur_size) { |
| 261 | | | |
| 262 | | | if (o_stream_send(ctx->client->output, "\r\n", 2) < 0) |
Redundant Condition
o_stream_send(...) < 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 o_stream_send(...) < 0 cannot be true.
- A crashing bug occurs on every path where o_stream_send(...) < 0 could have evaluated to true. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 263 | | | return -1; |
| 264 | | | ctx->cur_offset += 2; |
| 265 | | | ctx->cur_append_eoh = FALSE; |
| 266 | | | } |
| 267 | | | |
| 268 | | | if (ctx->cur_offset != ctx->cur_size) { |
| 269 | | | |
| 270 | | | if (!i_stream_have_bytes_left(ctx->cur_input)) { |
| 271 | | | |
| 272 | | | i_error("FETCH %s for mailbox %s UID %u " |
| 273 | | | "got too little data (copying): " |
| 274 | | | "%"PRIuUOFF_T" vs %"PRIuUOFF_T, |
| 275 | | | ctx->cur_name, mailbox_get_name(ctx->mail->box), |
| 276 | | | ctx->mail->uid, ctx->cur_offset, ctx->cur_size); |
| 277 | | | client_disconnect(ctx->client, "FETCH failed"); |
| 278 | | | return -1; |
| 279 | | | } |
| 280 | | | |
| 281 | | | o_stream_set_flush_pending(ctx->client->output, TRUE); |
| 282 | | | return 0; |
| 283 | | | } |
| 284 | | | return 1; |
| 285 | | | } |
| |