mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-27 12:39:52 +01: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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user