Prevent crashing when `display.ini` is missing end `#` (#22471)

This commit is contained in:
s-hadinger 2024-11-14 08:24:20 +01:00 committed by GitHub
parent b195bcd88d
commit dd99642cf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Matter provisioning with matter.js controller (#22470)
- Prevent crashing when `display.ini` is missing end `#`
### Removed

View File

@ -680,14 +680,15 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) {
if (*lp == '\n' || *lp == ' ') { // Add space char
lp++;
} else {
lp = strchr(lp, '\n');
if (!lp) {
lp = strchr(lp, ' ');
if (!lp) {
char *lp1;
lp1 = strchr(lp, '\n');
if (!lp1) {
lp1 = strchr(lp, ' ');
if (!lp1) {
break;
}
}
lp++;
lp = lp1 + 1;
}
}