1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-04 21:04:18 +01:00

WUtil: fix posible crash in 'wgethomedir' (Coverity #50070)

As pointed by Coverity, if the user does not a an entry in the password
file then the function would assume its home path to be "/" but still
continue and later try to check for user->pw_dir which would dereference
the NULL pointer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-18 00:56:37 +02:00
committed by Carlos R. Mafra
parent 11497973ad
commit 978cb1f154

View File

@@ -57,6 +57,7 @@ char *wgethomedir()
if (!user) {
werror(_("could not get password entry for UID %i"), getuid());
home = "/";
return home;
}
if (!user->pw_dir)