Change last_idx type to int16 to properly avoid unpacking if the tlv length is 0

This commit is contained in:
Rúben Soares Silva
2025-08-22 15:17:47 +01:00
parent 207aac94d1
commit c957e11682
+1 -1
View File
@@ -2308,7 +2308,7 @@ uint8_t unpack_nr_srs_report_tlv_value(nfapi_srs_report_tlv_t *report_tlv, uint8
}
}
#else
const uint16_t last_idx = ((report_tlv->length + 3) / 4) - 1;
const int16_t last_idx = ((report_tlv->length + 3) / 4) - 1;
for (int i = 0; i < last_idx; i++) {
if (!pull32(ppReadPackedMsg, &report_tlv->value[i], end)) {
return 0;