1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

ble/skald: Always enforce URL length check

Co-authored-by: benpicco <benpicco@googlemail.com>
This commit is contained in:
Teufelchen1 2024-04-15 12:33:12 +02:00
parent 3c3c5c281c
commit da790686f3

View File

@ -96,7 +96,10 @@ void skald_eddystone_url_adv(skald_ctx_t *ctx,
{
assert(url && ctx);
size_t len = strlen(url);
assert(len <= (NETDEV_BLE_PDU_MAXLEN - (URL_HDR_LEN + PREAMBLE_LEN)));
if (len <= (NETDEV_BLE_PDU_MAXLEN - (URL_HDR_LEN + PREAMBLE_LEN))) {
assert(0);
return;
}
eddy_url_t *pdu = (eddy_url_t *)ctx->pkt.pdu;
_init_pre(&pdu->pre, EDDYSTONE_URL, (URL_HDR_LEN + len));