offset += 4;
header_len += 4;
- if (offset >= length)
+ if ((offset + rec_header->payload_len) > length)
goto fail;
}
rec_header->il_length = rec[offset++];
header_len++;
- if (offset >= length)
+ if ((offset + rec_header->payload_len) > length)
goto fail;
}
offset += rec_header->type_len;
header_len += rec_header->type_len;
- if (offset >= length)
+ if ((offset + rec_header->payload_len) > length)
goto fail;
}
offset += rec_header->il_length;
header_len += rec_header->il_length;
- if (offset >= length)
+ if ((offset + rec_header->payload_len) > length)
goto fail;
}
- if ((offset + rec_header->payload_len) > length)
- goto fail;
-
rec_header->rec_type = get_record_type(rec_header->tnf, type,
rec_header->type_len);
rec_header->offset = offset;