media-session: fix match rule

When matching without regex, don't just to a startswith check but also
check that the sizes of the strings match.

Fixes #1098
This commit is contained in:
Wim Taymans 2021-04-25 13:47:23 +02:00
parent 53cd601869
commit a611128a79

View file

@ -72,7 +72,8 @@ static bool find_match(struct spa_json *arr, struct pw_properties *props)
success = true;
regfree(&preg);
}
} else if (strncmp(str, value, len) == 0) {
} else if (strncmp(str, value, len) == 0 &&
strlen(str) == (size_t)len) {
success = true;
}
}