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:
parent
ac2140717c
commit
cf85a4c677
1 changed files with 1 additions and 1 deletions
|
|
@ -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(>wa->commFifo, false) && (gtwa->state == CO_GTWA_ST_IDLE)) {
|
||||
char tok[20];
|
||||
char tok[21];
|
||||
size_t n;
|
||||
uint32_t ui[3];
|
||||
int32_t i;
|
||||
|
|
|
|||
Loading…
Reference in a new issue