pulse-server: don't read past the end of the string

This commit is contained in:
Wim Taymans 2021-03-01 13:56:10 +01:00
parent 9662bc96ab
commit 15e6a825f2

View file

@ -132,14 +132,16 @@ static void add_props(struct pw_properties *props, const char *str)
} else { } else {
f = ' '; f = ' ';
} }
v = p;
e = strchr(p, f); e = strchr(p, f);
if (e == NULL) if (e == NULL)
e = strchr(p, '\0'); e = strchr(p, '\0');
if (e == NULL) if (e == NULL)
break; break;
p = e;
if (*e != '\0')
p++;
*e = '\0'; *e = '\0';
v = p;
p = e + 1;
pw_properties_set(props, k, v); pw_properties_set(props, k, v);
} }
free(s); free(s);