Skip to content

Commit

Permalink
Prevent crashing when display.ini is missing end # (#22471)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Nov 14, 2024
1 parent b195bcd commit dd99642
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions lib/lib_display/UDisplay/uDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit dd99642

Please sign in to comment.