Browse Source

* CMD_SIGN_DATA null check

pull/105/head
Scott Powell 1 year ago
parent
commit
31f8576640
  1. 2
      examples/companion_radio/main.cpp

2
examples/companion_radio/main.cpp

@ -1282,7 +1282,7 @@ public:
sign_data = (uint8_t *) malloc(MAX_SIGN_DATA_LEN);
sign_data_len = 0;
} else if (cmd_frame[0] == CMD_SIGN_DATA && len > 1) {
if (sign_data_len + (len - 1) > MAX_SIGN_DATA_LEN) {
if (sign_data == NULL || sign_data_len + (len - 1) > MAX_SIGN_DATA_LEN) {
writeErrFrame(); // error: too long
} else {
memcpy(&sign_data[sign_data_len], &cmd_frame[1], len - 1);

Loading…
Cancel
Save