diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index c29d45648..f6dd56847 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -919,7 +919,7 @@ static char **pw_strv_insert_at(char **strv, int len, int pos, const char *str) len++; } if (pos < 0 || pos > len) - pos = len+1; + pos = len; n = realloc(strv, sizeof(char*) * (len + 2)); if (n == NULL) {