Skip to content

Fix SPI memory leak #138

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 Oct 24, 2017
Merged

Fix SPI memory leak #138

merged 1 commit into from Oct 24, 2017

Conversation

ghost
Copy link

@ghost ghost commented Oct 24, 2017

SPI library patched to remove overrun of an array causing random behaviour.
There is no problem with UART layer.
The WiFi library is OK now.

@ghost ghost added the bug 🐛 Something isn't working label Oct 24, 2017
@ghost ghost self-assigned this Oct 24, 2017
@ghost ghost requested review from cparata and fpistm October 24, 2017 07:56
tmp = ((data & 0xff00) >> 8) | ((data & 0xff) << 8);
data = tmp;
uint8_t idx = pinIdx(_pin, GET_IDX);
if(idx == NB_SPI_SETTINGS) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this would even be safer to check
if(idx >= NB_SPI_SETTINGS)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should be applied on all those same tests done in SPI.cpp

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@ghost ghost requested a review from LMESTM October 24, 2017 09:07
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several idx == NB_SPI_SETTINGS should be changed to idx >= NB_SPI_SETTINGS

Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
@ghost ghost requested a review from fpistm October 24, 2017 09:30
@fpistm fpistm merged commit bfd0d0a into stm32duino:master Oct 24, 2017
@ghost ghost deleted the fix_spi_memory_leak branch November 8, 2017 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants