mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 21:03:10 +02:00
gutils: Avoid null dereference if getpwuid fails to acquire some information about user
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
parent
9ed4b813e5
commit
17d6fc4e64
@ -681,7 +681,7 @@ g_get_user_database_entry (void)
|
|||||||
e.user_name = g_strdup (pw->pw_name);
|
e.user_name = g_strdup (pw->pw_name);
|
||||||
|
|
||||||
#ifndef __BIONIC__
|
#ifndef __BIONIC__
|
||||||
if (pw->pw_gecos && *pw->pw_gecos != '\0')
|
if (pw->pw_gecos && *pw->pw_gecos != '\0' && pw->pw_name)
|
||||||
{
|
{
|
||||||
gchar **gecos_fields;
|
gchar **gecos_fields;
|
||||||
gchar **name_parts;
|
gchar **name_parts;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user