Skip to content

Fix hard fault when str is NULL #259

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

Merged
merged 1 commit into from
Aug 31, 2022
Merged

Fix hard fault when str is NULL #259

merged 1 commit into from
Aug 31, 2022

Conversation

grobx
Copy link

@grobx grobx commented Aug 30, 2022

BLEDevice::discoverService execute ATT.discoverAttributes(_addressType, _address, NULL) passing NULL as 3rd argument, that is eventually passed to BLEUuid constructor where it is used in strlen(str).

Since dereferencing null pointer is UB, we should avoid to call strlen(len).

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2022

CLA assistant check
All committers have signed the CLA.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Aug 30, 2022
@facchinm
Copy link
Contributor

LGTM! Thanks for the contribution, merging

@facchinm facchinm merged commit 2a1cf72 into arduino-libraries:master Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants