input sanitization - TinyGPS course()

Reduce the impact of issue #863 (and similar issues in the future) by filtering out obvious bogons
1.2-legacy
a-f-G-U-C 2021-09-10 15:12:12 +00:00 zatwierdzone przez GitHub
rodzic b9443d87aa
commit c442fd3886
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -163,7 +163,12 @@ bool NMEAGPS::lookForLocation()
}
if (reader.course.isUpdated() && reader.course.isValid()) {
heading = reader.course.value() * 1e3; // Scale the heading (in degrees * 10^-2) to match the expected degrees * 10^-5
if (reader.course.value() < 36000) { // sanity check
heading = reader.course.value() * 1e3; // Scale the heading (in degrees * 10^-2) to match the expected degrees * 10^-5
} else {
DEBUG_MSG("BOGUS course.value() REJECTED: %d\n",
reader.course.value());
}
}
/*