(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-map.c) |
| |
| 158 | | | int mail_index_map_ext_hdr_check(const struct *hdr, |
| 159 | | | const struct *ext_hdr, |
| 160 | | | const char *name, const char **error_r) |
| 161 | | | { |
| 162 | | | if ((ext_hdr->record_size == 0 && ext_hdr->hdr_size == 0) || |
Event 1:
Skipping " if". - ext_hdr->record_size == 0 evaluates to true.
- ext_hdr->hdr_size == 0 evaluates to false.
- ext_hdr->record_align == 0 evaluates to true.
- ext_hdr->record_size != 0 evaluates to false.
hide
|
|
| 163 | | | (ext_hdr->record_align == 0 && ext_hdr->record_size != 0)) { |
Event 2:
Considering the case where ext_hdr->record_align must have been equal to 0.
hide
|
|
| 164 | | | *error_r = "Invalid field values"; |
| 165 | | | return -1; |
| 166 | | | } |
| 167 | | | if (*name == '\0') { |
Event 3:
Skipping " if". *name == 0 evaluates to false.
hide
|
|
| 168 | | | *error_r = "Broken name"; |
| 169 | | | return -1; |
| 170 | | | } |
| 171 | | | |
| 172 | | | |
| 173 | | | |
| 174 | | | if (ext_hdr->record_offset != 0 && |
Event 4:
Skipping " if". - ext_hdr->record_offset != 0 evaluates to true.
- ext_hdr->record_offset + ext_hdr->record_size > hdr->record_size evaluates to false.
hide
|
|
| 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 && |
Event 5:
Skipping " if". ext_hdr->record_size > 0 evaluates to false.
hide
|
|
| 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 && |
Event 6:
ext_hdr->record_offset != 0 evaluates to true.
hide
|
|
| 191 | | | (hdr->record_size % ext_hdr->record_align) != 0) { |
Division By Zero
A value is divided by ext_hdr->record_align, which must be equal to 0. The issue can occur if the highlighted code executes. See related event 2. Show: All events | Only primary events |
|
| |