Skip to content

Commit

Permalink
Merge pull request #20577 from Teufelchen1/fix/eddystone
Browse files Browse the repository at this point in the history
ble/skald: Always enforce URL length check
  • Loading branch information
maribu authored Apr 16, 2024
2 parents 48838f4 + da79068 commit d708f8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sys/net/ble/skald/skald_eddystone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d708f8d

Please sign in to comment.