l2cap: check packet size against local mtu for classic basic channels

This commit is contained in:
Matthias Ringwald 2020-11-23 18:03:24 +01:00
parent 4fc83f45ae
commit 0763891b99
2 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- L2CAP: use connection handle for channel lookups
- L2CAP: forward data only in open state
### Added
### Changed
- L2CAP: check packet size against local mtu for classic basic channels
## Release v1.2

View File

@ -3538,8 +3538,11 @@ static void l2cap_acl_classic_handler_for_channel(l2cap_channel_t * l2cap_channe
return;
}
#endif
l2cap_dispatch_to_channel(l2cap_channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], size-COMPLETE_L2CAP_HEADER);
// check size
if (l2cap_channel->local_mtu < size) return;
l2cap_dispatch_to_channel(l2cap_channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], size-COMPLETE_L2CAP_HEADER);
}
#endif