media-session: avoid strcmp on unterminated string

The string might not be 0 terminated so use the length to set a
limit for strcmp.
This commit is contained in:
Wim Taymans 2021-03-25 17:29:19 +01:00
parent 4ab4c57a55
commit 5629885e41

View file

@ -111,7 +111,7 @@ static void on_notify_events(void *data, int fd, uint32_t mask)
event = (const struct inotify_event *) p; event = (const struct inotify_event *) p;
if ((event->mask & IN_ATTRIB)) { if ((event->mask & IN_ATTRIB)) {
if (strcmp(event->name, SEQ_NAME) != 0) if (strncmp(event->name, SEQ_NAME, event->len) != 0)
continue; continue;
if (impl->proxy == NULL && if (impl->proxy == NULL &&
check_access(impl) && check_access(impl) &&