mirror of https://gerrit.osmocom.org/osmo-tetra
tetra_mac_pdu: Prevent array overflow of addr_len_by_type[]
detected by Smatch
This commit is contained in:
parent
6d7b343149
commit
abc2eb2b97
|
@ -193,6 +193,9 @@ int macpdu_decode_resource(struct tetra_resrc_decoded *rsd, const uint8_t *bits)
|
|||
rsd->addr.ssi = bits_to_uint(cur, 24);
|
||||
rsd->addr.usage_marker = bits_to_uint(cur, 6);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
cur += addr_len_by_type[rsd->addr.type];
|
||||
/* no intermediate napping in pi/4 */
|
||||
|
|
Loading…
Reference in New Issue