nuttx-apps/examples/gps
Old-Ding e94e89113a examples: gps: bound NMEA line reads
The GPS example appends serial input to a fixed-size NMEA line buffer until CR or LF without checking the buffer limit. A malformed or overlong input line can write past the end of line[], and the code also uses ch even when read() does not return a byte.

Read bytes only after a successful read(), stop storing at MINMEA_MAX_LENGTH - 1, drain overlong lines until the line ending, and skip parsing truncated sentences.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:31:53 +08:00
..
CMakeLists.txt examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
gps_main.c examples: gps: bound NMEA line reads 2026-07-06 16:31:53 +08:00
Kconfig examples/gps: Allow GPS serial port to be specified as command line argument, mark MINMEA dependency in Kconfig. 2025-01-23 14:31:14 +08:00
Make.defs examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00