File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ pwcopy(struct passwd *pw)
506506 copy -> pw_name = xstrdup (pw -> pw_name );
507507 copy -> pw_passwd = xstrdup (pw -> pw_passwd == NULL ? "*" : pw -> pw_passwd );
508508#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
509- copy -> pw_gecos = xstrdup (pw -> pw_gecos );
509+ copy -> pw_gecos = xstrdup (pw -> pw_gecos == NULL ? "" : pw -> pw_gecos );
510510#endif
511511 copy -> pw_uid = pw -> pw_uid ;
512512 copy -> pw_gid = pw -> pw_gid ;
@@ -517,10 +517,10 @@ pwcopy(struct passwd *pw)
517517 copy -> pw_change = pw -> pw_change ;
518518#endif
519519#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
520- copy -> pw_class = xstrdup (pw -> pw_class );
520+ copy -> pw_class = xstrdup (pw -> pw_class == NULL ? "" : pw -> pw_class );
521521#endif
522- copy -> pw_dir = xstrdup (pw -> pw_dir );
523- copy -> pw_shell = xstrdup (pw -> pw_shell );
522+ copy -> pw_dir = xstrdup (pw -> pw_dir == NULL ? "" : pw -> pw_dir );
523+ copy -> pw_shell = xstrdup (pw -> pw_shell == NULL ? "" : pw -> pw_shell );
524524 return copy ;
525525}
526526
You can’t perform that action at this time.
0 commit comments