tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
607 stars 192 forks source link

Fixing issue #417: avoid panic in GPS Parser #633

Closed ValentinMontmirail closed 9 months ago

ValentinMontmirail commented 9 months ago

Fix #417

In its current shape, the driver would panic due to index being out of range. @ipsusila is perfectly correct.

I ran into the same problem, I am doing the PR myself since it has not been done before. We need to ensure that the parsing is only until 9 bytes, since the length of NMEA time field (hhmmss.ss) is 9 bytes.