Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mme): Updating state converter's plmn_bytes array to be null-terminated #11891

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lte/gateway/c/core/oai/common/state_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void StateConverter::guti_to_proto(const guti_t& state_guti,
oai::Guti* guti_proto) {
guti_proto->Clear();

char plmn_array[PLMN_BYTES];
char plmn_array[PLMN_BYTES + 1];
plmn_to_chars(state_guti.gummei.plmn, plmn_array);
guti_proto->set_plmn(plmn_array);
guti_proto->set_mme_gid(state_guti.gummei.mme_gid);
Expand All @@ -74,7 +74,7 @@ void StateConverter::ecgi_to_proto(const ecgi_t& state_ecgi,
oai::Ecgi* ecgi_proto) {
ecgi_proto->Clear();

char plmn_array[PLMN_BYTES];
char plmn_array[PLMN_BYTES + 1];
plmn_to_chars(state_ecgi.plmn, plmn_array);
ecgi_proto->set_plmn(plmn_array);
ecgi_proto->set_enb_id(state_ecgi.cell_identity.enb_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void S1apStateConverter::supported_tai_item_to_proto(
supported_tai_item_proto->set_tac(state_supported_tai_item->tac);
supported_tai_item_proto->set_bplmnlist_count(
state_supported_tai_item->bplmnlist_count);
char plmn_array[PLMN_BYTES] = {0};
char plmn_array[PLMN_BYTES + 1] = {0};
for (int idx = 0; idx < state_supported_tai_item->bplmnlist_count; idx++) {
plmn_array[0] =
(char)(state_supported_tai_item->bplmns[idx].mcc_digit1 + ASCII_ZERO);
Expand Down