[SX126x] Added missing length check
This commit is contained in:
parent
b75904cce1
commit
fe54a30819
1 changed files with 5 additions and 0 deletions
|
@ -343,6 +343,11 @@ int16_t SX126x::startTransmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||||
// suppress unused variable warning
|
// suppress unused variable warning
|
||||||
(void)addr;
|
(void)addr;
|
||||||
|
|
||||||
|
// check packet length
|
||||||
|
if(len >= 256) {
|
||||||
|
return(ERR_PACKET_TOO_LONG);
|
||||||
|
}
|
||||||
|
|
||||||
// set packet Length
|
// set packet Length
|
||||||
int16_t state = ERR_NONE;
|
int16_t state = ERR_NONE;
|
||||||
uint8_t modem = getPacketType();
|
uint8_t modem = getPacketType();
|
||||||
|
|
Loading…
Add table
Reference in a new issue