mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-16 07:00:00 -05:00
json: init value to ->cur instead of NULL
Or else we end up with a return value of ->cur - NULL, which might look lik a positive result and cause a crash later on. Fixes #641
This commit is contained in:
parent
c64bf36e8e
commit
6370d75efd
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ static inline int spa_json_next(struct spa_json * iter, const char **value)
|
|||
int utf8_remain = 0;
|
||||
enum { __NONE, __STRUCT, __BARE, __STRING, __UTF8, __ESC, __COMMENT };
|
||||
|
||||
*value = NULL;
|
||||
*value = iter->cur;
|
||||
for (; iter->cur < iter->end; iter->cur++) {
|
||||
unsigned char cur = (unsigned char)*iter->cur;
|
||||
again:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue