Old-Ding opened a new pull request, #3603:
URL: https://github.com/apache/nuttx-apps/pull/3603

   ## Summary
   - check that `read()` actually returned one byte before using `ch`
   - stop storing NMEA line bytes at `MINMEA_MAX_LENGTH - 1`
   - drain and skip overlong lines instead of parsing a truncated sentence
   
   ## Why
   The GPS example reads serial data until CR or LF and appends every byte to 
`line[]`. A malformed or overlong sentence can write past the fixed 256-byte 
buffer, and ignoring the return value of `read()` can reuse a stale `ch` value 
when no byte was read.
   
   ## Testing
   - `git diff --check HEAD~1..HEAD`
   - `git show --stat --check --format=fuller HEAD`
   - Not run: local NuttX apps build, because this Windows workstation does not 
have `gcc`, `clang`, or `cc` installed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to