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

Cellular: fix calls to ATHandler::read_string(...) give correct size #10465

Merged
merged 1 commit into from May 3, 2019

Conversation

Projects
None yet
6 participants
@jarvte
Copy link
Contributor

commented Apr 24, 2019

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

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@AriParkkila @mirelachirica

Release Notes

@@ -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));

This comment has been minimized.

Copy link
@AriParkkila

AriParkkila Apr 25, 2019

Contributor

Fix sizeof(pdp_type_from_context) two lines above as well?

This comment has been minimized.

Copy link
@jarvte

jarvte Apr 25, 2019

Author Contributor

good catch, fixed.

if (len > 0) {
imsi[len] = '\0';
}
_at.read_string(imsi, MAX_IMSI_LENGTH + 1);

This comment has been minimized.

Copy link
@AriParkkila

AriParkkila Apr 25, 2019

Contributor

Fix _at.read_string(buf, buf_size - 1); at AT_CellularInformation::get_info too?

This comment has been minimized.

Copy link
@jarvte

jarvte Apr 25, 2019

Author Contributor

good catch, fixed.

Cellular: fix calls to ATHandler::read_string(...) give correct size
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 jarvte force-pushed the jarvte:fix_imsi_length branch from 03ded53 to 1abf600 Apr 25, 2019

@ciarmcom ciarmcom requested review from AriParkkila, mirelachirica and ARMmbed/mbed-os-maintainers Apr 25, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

@0xc0170

0xc0170 approved these changes May 2, 2019

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 2, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented May 2, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented May 2, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 13880dc into ARMmbed:master May 3, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage Success
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8471 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details

@0xc0170 0xc0170 removed the ready for merge label May 3, 2019

@jarvte jarvte deleted the jarvte:fix_imsi_length branch May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.