liblte: add length on plmn list

master
b1u3s 2 years ago committed by Justin Tallon
parent b7100efd84
commit 43fc466ff9

@ -612,6 +612,9 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8** ie_ptr, LIBLTE_MME_PLMN
if (ie_ptr != NULL && plmn_list != NULL) { if (ie_ptr != NULL && plmn_list != NULL) {
plmn_list->N_plmns = (*ie_ptr)[0] / 3; plmn_list->N_plmns = (*ie_ptr)[0] / 3;
if (plmn_list->N_plmns > LIBLTE_MME_PLMN_LIST_MAX_SIZE) {
return (err);
}
for (i = 0; i < plmn_list->N_plmns; i++) { for (i = 0; i < plmn_list->N_plmns; i++) {
plmn_list->mcc[i] = ((*ie_ptr)[i * 3 + 0] & 0x0F) * 100; plmn_list->mcc[i] = ((*ie_ptr)[i * 3 + 0] & 0x0F) * 100;
plmn_list->mcc[i] += (((*ie_ptr)[i * 3 + 0] >> 4) & 0x0F) * 10; plmn_list->mcc[i] += (((*ie_ptr)[i * 3 + 0] >> 4) & 0x0F) * 10;
@ -3213,7 +3216,7 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8** ie_ptr,
msg->N_bytes |= (*ie_ptr)[1]; msg->N_bytes |= (*ie_ptr)[1];
if (msg->N_bytes > LIBLTE_MAX_MSG_SIZE_BYTES) { if (msg->N_bytes > LIBLTE_MAX_MSG_SIZE_BYTES) {
return err; return (err);
} }
for (i = 0; i < msg->N_bytes; i++) { for (i = 0; i < msg->N_bytes; i++) {

Loading…
Cancel
Save