bluez5: bap: Rework broadcast code length check

Co-authored-by: P V <pav@iki.fi>
This commit is contained in:
Vlad Pruteanu 2024-06-20 12:27:00 +00:00 committed by Wim Taymans
parent 4c1271805e
commit 88d9d58333

View file

@ -6174,8 +6174,9 @@ static void parse_broadcast_source_config(struct spa_bt_monitor *monitor, const
if (spa_streq(key, "broadcast_code")) {
if (spa_json_get_string(&it[1], bcode, sizeof(bcode)) <= 0)
goto parse_failed;
if (strlen(bcode) <= 16)
memcpy(big_entry->broadcast_code, bcode, strlen(bcode));
if (strlen(bcode) > BROADCAST_CODE_LEN)
goto parse_failed;
memcpy(big_entry->broadcast_code, bcode, strlen(bcode));
spa_log_debug(monitor->log, "big_entry->broadcast_code %s", big_entry->broadcast_code);
} else if (spa_streq(key, "encryption")) {
if (spa_json_get_bool(&it[1], &big_entry->encryption) <= 0)