mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-29 08:42:49 +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++;
|
seuser++;
|
||||||
level = strchr(seuser, ':');
|
level = strchr(seuser, ':');
|
||||||
|
if (! level) goto err;
|
||||||
*level = 0;
|
*level = 0;
|
||||||
level++;
|
level++;
|
||||||
*r_seuser = strdup(seuser);
|
*r_seuser = strdup(seuser);
|
||||||
|
Loading…
Reference in New Issue
Block a user