Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Address of local variable buffer is assigned to a non-local variable #1046

Open
b4yuan opened this issue Aug 13, 2023 · 0 comments
Open

Address of local variable buffer is assigned to a non-local variable #1046

b4yuan opened this issue Aug 13, 2023 · 0 comments

Comments

@b4yuan
Copy link

b4yuan commented Aug 13, 2023

NRF_SAADC->RESULT.PTR = (uint32_t) buffer;

A stack address is assigned to a non-local variable. Storing the address of a local variable in non-local memory can cause a dangling pointer bug if the address is used after the function returns.

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

No branches or pull requests

1 participant