This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Serialization for S132 5.x triggers buffer overflow in event scheduling

Hi

The serial connection handler "ser_conn_handlers.c" may case an INVALID_LENGTH error when receiving Advertise Reports (or other long BLE events). The reason for this is that the application scheduler is fed with a length including the header size (4 bytes) and the length in the "len" field of the header. This is not correct as the "len" field includes the header size (see definition of the header).

Events with a length near the calculated max event length will cause the INVALID_LENGTH error as the additional 4 bytes cause the size to be to large for the application scheduler.

I short look at the older SDK's showed that this bug isn't new, but it rarely occurred because the max event size was calculated another way.

Regards Adrian

Related