-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: fix calls to ATHandler::read_string(...) give correct size #10465
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
Conversation
@@ -396,7 +396,7 @@ bool AT_CellularContext::get_context() | |||
char pdp_type_from_context[10]; | |||
int pdp_type_len = _at.read_string(pdp_type_from_context, sizeof(pdp_type_from_context) - 1); | |||
if (pdp_type_len > 0) { | |||
apn_len = _at.read_string(apn, sizeof(apn) - 1); | |||
apn_len = _at.read_string(apn, sizeof(apn)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix sizeof(pdp_type_from_context)
two lines above as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed.
if (len > 0) { | ||
imsi[len] = '\0'; | ||
} | ||
_at.read_string(imsi, MAX_IMSI_LENGTH + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix _at.read_string(buf, buf_size - 1);
at AT_CellularInformation::get_info
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed.
ATHandler::read_string(...) buffer size param was changed a long time ago to include also NULL. Some calls still gave wrong size after this change.
@jarvte, thank you for your changes. |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
ATHandler::read_string(...) buffer size param was changed a long time ago to include also NULL. Some calls still gave wrong size after this change.
Pull request type
Reviewers
@AriParkkila @mirelachirica
Release Notes