Text   |  XML   |  ReML   |   Visible Warnings:

Division By Zero  at mail-index-map.c:191

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

mail_index_map_ext_hdr_check

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-map.c)expand/collapse
Show more  
 158  int mail_index_map_ext_hdr_check(const struct mail_index_header *hdr,
 159                                   const struct mail_index_ext_header *ext_hdr,
 160                                   const char *name, const char **error_r)
 161  {
 162          if ((ext_hdr->record_size == 0 && ext_hdr->hdr_size == 0) ||
 163              (ext_hdr->record_align == 0 && ext_hdr->record_size != 0)) {
 164                  *error_r = "Invalid field values";
 165                  return -1;
 166          }
 167          if (*name == '\0') {
 168                  *error_r = "Broken name";
 169                  return -1;
 170          }
 171   
 172          /* if we get here from extension introduction, record_offset=0 and 
 173             hdr->record_size hasn't been updated yet */
 174          if (ext_hdr->record_offset != 0 &&
 175              ext_hdr->record_offset + ext_hdr->record_size > hdr->record_size) {
 176                  *error_r = t_strdup_printf("Record field points "
 177                                             "outside record size (%u+%u > %u)",
 178                                             ext_hdr->record_offset,
 179                                             ext_hdr->record_size,
 180                                             hdr->record_size);
 181                  return -1;
 182          }
 183   
 184          if (ext_hdr->record_size > 0 &&
 185              (ext_hdr->record_offset % ext_hdr->record_align) != 0) {
 186                  *error_r = t_strdup_printf("Record field alignment %u "
 187                                             "not used", ext_hdr->record_align);
 188                  return -1;
 189          }
 190          if (ext_hdr->record_offset != 0 &&
 191              (hdr->record_size % ext_hdr->record_align) != 0) {
Show more  




Change Warning 7213.24756 : Division By Zero

Priority:
State:
Finding:
Owner:
Note: