Skip to content
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

Dangerous edge case for non-null-terminated string #1168

Closed
wants to merge 1 commit into from

Conversation

bobwolff68
Copy link

strncpy() does not place a null terminator when the max characters is reached of '9' in this case. So, any buttons with 9 or more in the source will wind up with a potentially non-null-terminated _label.

strncpy() does not place a null terminator when the max characters is reached of '9' in this case. So, any buttons with 9 or more in the source will wind up with a potentially non-null-terminated _label.
@Bodmer
Copy link
Owner

Bodmer commented May 6, 2021

Thanks for reporting this. It is also worth reporting this on the Adafruit_GFX library as that is the source of that code segment.

I will update TFTeSPI.

@Bodmer Bodmer added the bug label May 6, 2021
@bobwolff68
Copy link
Author

Great. I did do a PR for this on Adafruit-GFX also on your suggestion.

@Bodmer Bodmer closed this in 8164629 May 11, 2021
@Bodmer Bodmer added Fixed bug and removed bug labels May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants