Skip to content

Commit

Permalink
Fix malloc(0) in BLE Spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Oct 24, 2023
1 parent c5d44fe commit 15ea63b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion applications/external/ble_spam/protocols/easysetup.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ void easysetup_make_packet(uint8_t* out_size, uint8_t** out_packet, const Protoc
if(cfg && cfg->type != 0x00) {
type = cfg->type;
} else {
type = rand() % EasysetupTypeCOUNT;
const EasysetupType types[] = {
EasysetupTypeBuds,
EasysetupTypeWatch,
};
type = types[rand() % COUNT_OF(types)];
}

uint8_t size = packet_sizes[type];
Expand Down

0 comments on commit 15ea63b

Please sign in to comment.