mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
json: add spa_json_parse_stringn()
It also checks the destination size.
This commit is contained in:
parent
c46113faa3
commit
611591d0fc
9 changed files with 30 additions and 20 deletions
|
|
@ -130,7 +130,8 @@ static int do_match(const char *rules, struct spa_dict *dict, uint32_t *no_featu
|
|||
if (spa_json_is_null(value, len)) {
|
||||
value = NULL;
|
||||
} else {
|
||||
spa_json_parse_string(value, SPA_MIN(len, (int)sizeof(val)-1), val);
|
||||
if (spa_json_parse_stringn(value, len, val, sizeof(val)) < 0)
|
||||
continue;
|
||||
value = val;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue