mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
json: spa_json_get_string() writes up to len chars or fail
This commit is contained in:
parent
68b31d37d9
commit
c46113faa3
17 changed files with 26 additions and 26 deletions
|
|
@ -75,7 +75,7 @@ static int match(const char *rules, struct spa_dict *dict, uint64_t *quirks)
|
|||
int match = true;
|
||||
uint64_t quirks_cur = 0;
|
||||
|
||||
while (spa_json_get_string(&it[0], key, sizeof(key)-1) > 0) {
|
||||
while (spa_json_get_string(&it[0], key, sizeof(key)) > 0) {
|
||||
char val[4096];
|
||||
const char *str, *value;
|
||||
int len;
|
||||
|
|
@ -83,7 +83,7 @@ static int match(const char *rules, struct spa_dict *dict, uint64_t *quirks)
|
|||
|
||||
if (spa_streq(key, "quirks")) {
|
||||
if (spa_json_enter_array(&it[0], &it[1]) > 0) {
|
||||
while (spa_json_get_string(&it[1], val, sizeof(val)-1) > 0)
|
||||
while (spa_json_get_string(&it[1], val, sizeof(val)) > 0)
|
||||
quirks_cur |= parse_quirks(val);
|
||||
}
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue