Skip to content

Commit

Permalink
fix crash on empty timezone parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
CaCO3 committed Mar 12, 2023
1 parent ad8dd71 commit d9cb0e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/components/jomjol_time_sntp/time_sntp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ bool setupTime() {
splitted = ZerlegeZeile(line, "=");

if (toUpper(splitted[0]) == "TIMEZONE") {
timeZone = splitted[1];
if (splitted.size() <= 1) { // parameter part is empty
timeZone = "";
}
else {
timeZone = splitted[1];
}
}

if (toUpper(splitted[0]) == "TIMESERVER") {
Expand Down

0 comments on commit d9cb0e1

Please sign in to comment.