mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 05:43:28 +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:
@@ -681,7 +681,7 @@ g_get_user_database_entry (void)
|
||||
e.user_name = g_strdup (pw->pw_name);
|
||||
|
||||
#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 **name_parts;
|
||||
|
Reference in New Issue
Block a user