-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi, I think this line can cause buffer overflow:
| buffer[index] = '\0'; |
because index can equal to bufferSize after this:
Arduino-StaticSerialCommands/src/StaticSerialCommands.cpp
Lines 77 to 79 in 35f192e
| } else if (index < bufferSize) { | |
| buffer[index] = ch; | |
| index++; |
I suggest to fix it by replacing else if (index < bufferSize) with else if (index < bufferSize - 1), ensuring that one byte is always left for the zero termination character.
Metadata
Metadata
Assignees
Labels
No labels