mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-17 10:50:43 +00:00
libselinux: seusers: Check for strchr failure
If we have a malformed seusers entry we may not find the : proceeding the level and would thus get a NULL. This can blow up. Check for this error and bail gracefully. Found by coverity Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
fa7a9a604e
commit
bd8ea2eb6c
@ -298,6 +298,7 @@ int getseuser(const char *username, const char *service,
|
||||
|
||||
seuser++;
|
||||
level = strchr(seuser, ':');
|
||||
if (! level) goto err;
|
||||
*level = 0;
|
||||
level++;
|
||||
*r_seuser = strdup(seuser);
|
||||
|
Loading…
Reference in New Issue
Block a user