Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at cmd-append.c:396

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

cmd_append_continue_message

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/cmd-append.c)expand/collapse
Show more  
 382  static bool cmd_append_continue_message(struct client_command_context *cmd)
 383  {
 384          struct client *client = cmd->client;
 385          struct cmd_append_context *ctx = cmd->context;
 386          size_t size;
 387          int ret;
 388   
 389          if (cmd->cancel) {
 390                  cmd_append_finish(ctx);
 391                  return TRUE;
 392          }
 393   
 394          if (ctx->save_ctx != NULL) {
 395                  while (ctx->input->v_offset != ctx->msg_size) {
 396                          ret = i_stream_read(ctx->input);
 397                          if (mailbox_save_continue(ctx->save_ctx) < 0) {
 398                                  /* we still have to finish reading the message
 399                                     from client */
 400                                  mailbox_save_cancel(&ctx->save_ctx);
 401                                  break;
 402                          }
 403                          if (ret == -1 || ret == 0)
 404                                  break;
 405                  }
 406          }
 407   
 408          if (ctx->save_ctx == NULL) {
 409                  (void)i_stream_read(ctx->input);
 410                  (void)i_stream_get_data(ctx->input, &size);
 411                  i_stream_skip(ctx->input, size);
 412          }
 413   
 414          if (ctx->input->eof || client->input->closed) {
 415                  bool all_written = ctx->input->v_offset == ctx->msg_size;
 416   
 417                  /* finished */
 418                  i_stream_unref(&ctx->input);
 419                  ctx->input = NULL;
 420   
 421                  if (ctx->save_ctx == NULL) {
 422                          /* failed above */
 423                          client_send_storage_error(cmd, ctx->storage);
 424                          ctx->failed = TRUE;
 425                  } else if (!all_written) {
 426                          /* client disconnected before it finished sending the 
 427                             whole message. */
 428                          ctx->failed = TRUE;
 429                          mailbox_save_cancel(&ctx->save_ctx);
 430                          client_disconnect(client, "EOF while appending");
 431                  } else if (mailbox_save_finish(&ctx->save_ctx) < 0) {
 432                          ctx->failed = TRUE;
 433                          client_send_storage_error(cmd, ctx->storage);
 434                  }
 435                  ctx->save_ctx = NULL;
 436   
 437                  if (client->input->closed) {
 438                          cmd_append_finish(ctx);
 439                          return TRUE;
 440                  }
 441   
 442                  /* prepare for next message */
 443                  ctx->message_input = FALSE;
 444                  imap_parser_reset(ctx->save_parser);
 445                  cmd->func = cmd_append_continue_parsing;
 446                  return cmd_append_continue_parsing(cmd);
 447          }
 448   
 449          return FALSE;
 450  }
Show more  




Change Warning 8174.26083 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: