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

Merge pull request #20577 from Teufelchen1/fix/eddystone

ble/skald: Always enforce URL length check
This commit is contained in:
Marian Buschsieweke 2024-04-16 06:04:33 +00:00 committed by GitHub
commit d708f8d0b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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));