tetra_mac_pdu: Prevent array overflow of addr_len_by_type[]

detected by Smatch
This commit is contained in:
Harald Welte 2011-07-16 18:05:44 +02:00
parent 6d7b343149
commit abc2eb2b97
1 changed files with 3 additions and 0 deletions

View File

@ -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 */