Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at index-mail.c:1062

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

index_mail_get_special

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/index-mail.c)expand/collapse
Show more  
 943  int index_mail_get_special(struct mail *_mail,
 944                             enum mail_fetch_field field, const char **value_r)
 945  {
 946          struct index_mail *mail = (struct index_mail *)_mail;
 947          struct index_mail_data *data = &mail->data;
 948          struct mail_cache_field *cache_fields = mail->ibox->cache_fields;
 949          string_t *str;
 950          const void *ext_data;
 951   
 952          switch (field) {
 953          case MAIL_FETCH_IMAP_BODY: {
 954                  unsigned int body_cache_field =
 955                          cache_fields[MAIL_CACHE_IMAP_BODY].idx;
 956                  unsigned int bodystructure_cache_field =
 957                          cache_fields[MAIL_CACHE_IMAP_BODYSTRUCTURE].idx;
 958   
 959                  if (data->body != NULL) {
 960                          *value_r = data->body;
 961                          return 0;
 962                  }
 963   
 964                  /* 1) use plain-7bit-ascii flag if it exists
 965                     2) get BODY if it exists 
 966                     3) get it using BODYSTRUCTURE if it exists 
 967                     4) parse body structure, and save BODY/BODYSTRUCTURE
 968                        depending on what we want cached */
 969   
 970                  str = str_new(mail->data_pool, 128);
 971                  if ((mail->data.cache_flags &
 972                       MAIL_CACHE_FLAG_TEXT_PLAIN_7BIT_ASCII) != 0 &&
 973                      get_cached_parts(mail)) {
 974                          index_mail_get_plain_bodystructure(mail, str, FALSE);
 975                          data->body = str_c(str);
 976                  } else if (index_mail_cache_lookup_field(mail, str,
 977                                                           body_cache_field) > 0)
 978                          data->body = str_c(str);
 979                  else if (index_mail_cache_lookup_field(mail, str,
 980                                          bodystructure_cache_field) > 0) {
 981                          data->bodystructure =
 982                                  p_strdup(mail->data_pool, str_c(str));
 983                          str_truncate(str, 0);
 984   
 985                          if (imap_body_parse_from_bodystructure(
 986                                                  data->bodystructure, str))
 987                                  data->body = str_c(str);
 988                          else {
 989                                  /* broken, continue.. */
 990                                  mail_set_cache_corrupted(_mail,
 991                                          MAIL_FETCH_IMAP_BODYSTRUCTURE);
 992                          }
 993                  }
 994   
 995                  if (data->body == NULL) {
 996                          str_free(&str);
 997                          if (index_mail_parse_bodystructure(mail,
 998                                                  MAIL_CACHE_IMAP_BODY) < 0)
 999                                  return -1;
 1000                  }
 1001                  i_assert(data->body != NULL);
 1002                  *value_r = data->body;
 1003                  return 0;
 1004          }
 1005          case MAIL_FETCH_IMAP_BODYSTRUCTURE: {
 1006                  unsigned int bodystructure_cache_field =
 1007                          cache_fields[MAIL_CACHE_IMAP_BODYSTRUCTURE].idx;
 1008   
 1009                  if (data->bodystructure != NULL) {
 1010                          *value_r = data->bodystructure;
 1011                          return 0;
 1012                  }
 1013   
 1014                  str = str_new(mail->data_pool, 128);
 1015                  if ((mail->data.cache_flags &
 1016                       MAIL_CACHE_FLAG_TEXT_PLAIN_7BIT_ASCII) != 0 &&
 1017                      get_cached_parts(mail)) {
 1018                          index_mail_get_plain_bodystructure(mail, str, TRUE);
 1019                          data->bodystructure = str_c(str);
 1020                  } else if (index_mail_cache_lookup_field(mail, str,
 1021                                          bodystructure_cache_field) > 0) {
 1022                          data->bodystructure = str_c(str);
 1023                  } else {
 1024                          str_free(&str);
 1025                          if (index_mail_parse_bodystructure(mail,
 1026                                          MAIL_CACHE_IMAP_BODYSTRUCTURE) < 0)
 1027                                  return -1;
 1028                  }
 1029                  i_assert(data->bodystructure != NULL);
 1030                  *value_r = data->bodystructure;
 1031                  return 0;
 1032          }
 1033          case MAIL_FETCH_IMAP_ENVELOPE:
 1034                  if (data->envelope == NULL) {
 1035                          if (index_mail_headers_get_envelope(mail) < 0)
 1036                                  return -1;
 1037                  }
 1038                  *value_r = data->envelope;
 1039                  return 0;
 1040          case MAIL_FETCH_FROM_ENVELOPE:
 1041          case MAIL_FETCH_UIDL_FILE_NAME:
 1042          case MAIL_FETCH_UIDL_BACKEND:
 1043          case MAIL_FETCH_SEARCH_SCORE:
 1044          case MAIL_FETCH_GUID:
 1045                  *value_r = "";
 1046                  return 0;
 1047          case MAIL_FETCH_HEADER_MD5:
 1048                  mail_index_lookup_ext(mail->trans->trans_view, data->seq,
 1049                                        mail->ibox->md5hdr_ext_idx,
 1050                                        &ext_data, NULL);
 1051                  if (ext_data == NULL) {
 1052                          *value_r = "";
 1053                          return 0;
 1054                  }
 1055                  *value_r = binary_to_hex(ext_data, 16);
 1056                  return 0;
 1057          case MAIL_FETCH_MAILBOX_NAME:
 1058                  *value_r = _mail->box->name;
 1059                  return 0;
 1060          default:
 1061                  i_unreached();
 1062                  return -1;
 1063          }
 1064  }
Show more  




Change Warning 7343.26060 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: