Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2393,13 +2393,13 @@ static void cmd_info(const Data *d, unsigned char *buf, int len) {
// Handler for incoming app commands
static void on_command_received(unsigned char *buffer, unsigned int len) {
Data *d = (Data *) ARG;
uint8_t magicnr = buffer[0];
uint8_t command = buffer[1];

if (len < 2) {
log_error("Received command data too short.");
Comment thread
mjc marked this conversation as resolved.
Resolved
return;
}

uint8_t magicnr = buffer[0];
uint8_t command = buffer[1];
if (magicnr != 101) {
log_error("Invalid Package ID: %u", magicnr);
Comment thread
mjc marked this conversation as resolved.
Resolved
return;
Expand Down