before dereferencing them.
+2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/groupmems.c (whoami): Make sure usr and grp are not NULL
+ before dereferencing them.
+
2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
* src/groupmems.c: Use xstrdup() rather than strdup().
/* local, no need for xgetpwuid */
struct passwd *usr = getpwuid (getuid ());
- if (0 == strcmp (usr->pw_name, grp->gr_name)) {
+ if ( (NULL != usr)
+ && (NULL != grp)
+ && (0 == strcmp (usr->pw_name, grp->gr_name))) {
return xstrdup (usr->pw_name);
} else {
return NULL;