int ret = 0;
struct ctf_field_class_int *int_fc;
struct ctf_field_class *fc;
- bool has_total_size = false;
- bool has_content_size = false;
if (sc->is_translated) {
goto end;
"`packet_size` member is signed.");
goto invalid;
}
-
- has_total_size = true;
}
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
"`content_size` member is signed.");
goto invalid;
}
-
- has_content_size = true;
- }
-
- if (has_content_size && !has_total_size) {
- BT_LOGE_STR("Invalid packet context field class: "
- "`content_size` member exists without "
- "`packet_size` member.");
- goto invalid;
}
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
if (notit->cur_exp_packet_total_size == -1) {
if (notit->cur_exp_packet_content_size != -1) {
- BT_LOGW("Content size is set, but packet size is not: "
- "notit-addr=%p, packet-context-field-addr=%p, "
- "packet-size=%" PRId64 ", content-size=%" PRId64,
- notit, notit->dscopes.stream_packet_context,
- notit->cur_exp_packet_total_size,
- notit->cur_exp_packet_content_size);
- status = BT_MSG_ITER_STATUS_ERROR;
- goto end;
+ notit->cur_exp_packet_total_size =
+ notit->cur_exp_packet_content_size;
}
} else {
if (notit->cur_exp_packet_content_size == -1) {
}
}
+ BT_ASSERT(notit->cur_exp_packet_total_size != -1);
+ BT_ASSERT(notit->cur_exp_packet_content_size != -1);
+
if (notit->cur_exp_packet_content_size >
notit->cur_exp_packet_total_size) {
BT_LOGW("Invalid packet or content size: "
ret = set_current_packet_content_sizes(notit);
if (ret) {
status = BT_MSG_ITER_STATUS_ERROR;
- goto end;
}
return status;