return -1;
}
- if (ext_hdr->record_offset + ext_hdr->record_size > hdr->record_size) {
+ /* if we get here from extension introduction, record_offset=0 and
+ hdr->record_size hasn't been updated yet */
+ if (ext_hdr->record_offset != 0 &&
+ ext_hdr->record_offset + ext_hdr->record_size > hdr->record_size) {
*error_r = t_strdup_printf("Record field points "
"outside record size (%u+%u > %u)",
ext_hdr->record_offset,
"not used", ext_hdr->record_align);
return -1;
}
- /* if we get here from extension introduction, record_offset=0 and
- hdr->record_size hasn't been updated yet */
if (ext_hdr->record_offset != 0 &&
(hdr->record_size % ext_hdr->record_align) != 0) {
*error_r = t_strdup_printf("Record size not aligned by %u "