1
0
Fork 0

fix: gateway tok[20] too small for lss_activate_bitrate command

The command string "lss_activate_bitrate" is exactly 20 characters.
CO_fifo_readToken() is called with count=sizeof(tok)=20. When exactly
20 characters are read, tokenSize==count which triggers the overflow
guard: *err=true and the token is discarded. The command therefore
always fails with a syntax error.

The buffer needs at least 21 bytes (20 chars + null terminator) to
successfully parse this command.

Fixes #623.
This commit is contained in:
Tristen Pierson 2026-05-31 16:40:29 -04:00
parent ac2140717c
commit cf85a4c677

View file

@ -599,7 +599,7 @@ CO_GTWA_process(CO_GTWA_t* gtwa, bool_t enable, uint32_t timeDifference_us, uint
***************************************************************************/
/* if idle, search for new command, skip comments or empty lines */
while (CO_fifo_CommSearch(&gtwa->commFifo, false) && (gtwa->state == CO_GTWA_ST_IDLE)) {
char tok[20];
char tok[21];
size_t n;
uint32_t ui[3];
int32_t i;