[glib: 1/3] gutils: Avoid null dereference if getpwuid fails to acquire some information about user
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/3] gutils: Avoid null dereference if getpwuid fails to acquire some information about user
- Date: Wed, 15 Jan 2020 18:14:31 +0000 (UTC)
commit 17d6fc4e643a15312a483eb4fa8dfa3f06a41e91
Author: Jakub Jelen <jjelen redhat com>
Date: Mon Jan 6 12:30:38 2020 +0100
gutils: Avoid null dereference if getpwuid fails to acquire some information about user
Signed-off-by: Jakub Jelen <jjelen redhat com>
glib/gutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gutils.c b/glib/gutils.c
index 6c89fc4cc..572c06ce6 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]