Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at imap-bodystructure.c:80

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

parse_content_type

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-imap/imap-bodystructure.c)expand/collapse
Show more  
 37  static void parse_content_type(struct message_part_body_data *data,
 38                                 struct message_header_line *hdr)
 39  {
 40          struct rfc822_parser_context parser;
 41          const char *value, *const *results;
 42          string_t *str;
 43          unsigned int i;
 44          bool charset_found = FALSE;
 45   
 46          rfc822_parser_init(&parser, hdr->full_value, hdr->full_value_len, NULL);
 47          (void)rfc822_skip_lwsp(&parser);
 48   
 49          str = t_str_new(256);
 50[+]         if (rfc822_parse_content_type(&parser, str) < 0)
 51                  return;
 52   
 53          /* Save content type and subtype */
 54          value = str_c(str);
 55          for (i = 0; value[i] != '\0'; i++) {
 56                  if (value[i] == '/') {
 57                          data->content_subtype =
 58                                  imap_quote(data->pool, str_data(str) + i + 1,
 59                                             str_len(str) - (i + 1));
 60                          break;
 61                  }
 62          }
 63          data->content_type =
 64[+]                 imap_quote(data->pool, str_data(str), i);
 65   
 66          /* parse parameters and save them */
 67          str_truncate(str, 0);
 68          (void)rfc2231_parse(&parser, &results);
 69          for (; *results != NULL; results += 2) {
 70                  if (strcasecmp(results[0], "charset") == 0)
 71                          charset_found = TRUE;
 72   
 73                  str_append_c(str, ' ');
 74                  imap_quote_append_string(str, results[0], TRUE);
 75                  str_append_c(str, ' ');
 76                  imap_quote_append_string(str, results[1], TRUE);
 77          }
 78   
 79          if (!charset_found &&
 80              strcasecmp(data->content_type, "\"text\"") == 0) {
Show more  




Change Warning 7170.24828 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: