Skip to content

Commit

Permalink
Fix buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
makuke1234 committed Apr 14, 2022
1 parent e90f9bd commit a87cd0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static inline void keyboardHandler(udp_t * restrict udp, char * restrict buffer,
breakFlag = true;
break;
}
else if ((kev->bKeyDown && (kev->wVirtualKeyCode == VK_RETURN)) || (len >= (MAX_BUF - 1)))
else if ((kev->bKeyDown && (kev->wVirtualKeyCode == VK_RETURN)) || (len >= (buflen - 1)))
{
// Send data
sendBuf[len] = '\0';
Expand Down

0 comments on commit a87cd0c

Please sign in to comment.