Merge branch 'fix-conf-branch' into 'master'

conf: clamp pw_strv_insert_at invalid pos to [0, len]

See merge request pipewire/pipewire!2800
This commit is contained in:
zhiwei zuo 2026-04-20 10:06:34 +00:00
commit e22cd8766c

View file

@ -919,7 +919,7 @@ static char **pw_strv_insert_at(char **strv, int len, int pos, const char *str)
len++; len++;
} }
if (pos < 0 || pos > len) if (pos < 0 || pos > len)
pos = len+1; pos = len;
n = realloc(strv, sizeof(char*) * (len + 2)); n = realloc(strv, sizeof(char*) * (len + 2));
if (n == NULL) { if (n == NULL) {