Skip to content

UMM_CALLOC doesn't check for NULL allocation #4207

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

Closed
earlephilhower opened this issue Jan 21, 2018 · 1 comment
Closed

UMM_CALLOC doesn't check for NULL allocation #4207

earlephilhower opened this issue Jan 21, 2018 · 1 comment

Comments

@earlephilhower
Copy link
Collaborator

Found in debug of #4134

memset(ret, 0x00, size);

UMM_CALLOC does an alloc then memset(0), but doesn't check the malloc succeeded, leading to a crash in UMM.

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Jan 21, 2018
Calloc was calling memset(0) on NULL when its implicit malloc failed,
causing a crash in UMM.  Instead, only do the memset if the memory
allocation succeeds.

Fixes issue esp8266#4207
earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Jan 21, 2018
Calloc was calling memset(0) on NULL when its implicit malloc failed,
causing a crash in UMM.  Instead, only do the memset if the memory
allocation succeeds.

Fixes issue esp8266#4207
igrr pushed a commit that referenced this issue Jan 21, 2018
Calloc was calling memset(0) on NULL when its implicit malloc failed,
causing a crash in UMM.  Instead, only do the memset if the memory
allocation succeeds.

Fixes issue #4207
@earlephilhower
Copy link
Collaborator Author

Closing, this was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant