From b6a8f677644994bab4401f461b34e8da00d7f86a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 30 Jul 2021 15:59:37 +1000 Subject: [PATCH] module-portal: use spa_atoi32 for safer PID parsing --- src/modules/module-portal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/module-portal.c b/src/modules/module-portal.c index 576fe1b44..8228ea7c5 100644 --- a/src/modules/module-portal.c +++ b/src/modules/module-portal.c @@ -114,8 +114,7 @@ context_check_access(void *data, struct pw_impl_client *client) if ((str = pw_properties_get(props, PW_KEY_SEC_PID)) == NULL) return; - pid = atoi(str); - if (pid != impl->portal_pid) + if (!spa_atoi32(str, &pid, 10) || pid != impl->portal_pid) return; items[0] = SPA_DICT_ITEM_INIT(PW_KEY_ACCESS, "portal");