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

Prevent underflow in heap size calculation #3898

Merged
merged 1 commit into from Mar 9, 2017

Conversation

Projects
None yet
3 participants
@c1728p9
Contributor

c1728p9 commented Mar 6, 2017

If the free memory on a device is small enough then the calculation to determine heap size could underflow to a large value. If this happens then malloc will never return failure and instead will cause a crash on allocation. This patch prevents the underflow so malloc works as expected even with low amounts of free memory.

This resolves #3210

Prevent underflow in heap size calculation
If the free memory on a device is small enough then the calculation to
determine heap size could underflow to a large value. If this happens
then malloc will never return failure and instead will cause a crash on
allocation. This patch prevents the underflow so malloc works as
expected even with low amounts of free memory.
@0xc0170

0xc0170 approved these changes Mar 7, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 7, 2017

/morph test

@0xc0170 0xc0170 added the needs: CI label Mar 7, 2017

@mbed-bot

This comment has been minimized.

mbed-bot commented Mar 7, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1649

All builds and test passed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 7, 2017

continuous-integration/jenkins/pr-head — Waiting for status to be reported

Seems not working? @c1728p9 Please check later, and we shall restart it

@0xc0170 0xc0170 closed this Mar 9, 2017

@0xc0170 0xc0170 reopened this Mar 9, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 9, 2017

@marhil01 Can you please restart jenkins? It can't access it via github.

@0xc0170 0xc0170 merged commit fefa91f into ARMmbed:master Mar 9, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test Job has started
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment