]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Avoid passing NULL to underlying fprintf() in sysusers (#20974)
author(GalaxyMaster) <galaxy4public@users.noreply.github.com>
Mon, 11 Oct 2021 05:03:15 +0000 (16:03 +1100)
committerGitHub <noreply@github.com>
Mon, 11 Oct 2021 05:03:15 +0000 (14:03 +0900)
src/sysusers/sysusers.c

index c55f7f8b7eebc742b3f220696cebe00707572e09..fafdef1706b1f685ddbbda6dd41d47c68adfcae4 100644 (file)
@@ -444,7 +444,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char
                         .pw_name = i->name,
                         .pw_uid = i->uid,
                         .pw_gid = i->gid,
-                        .pw_gecos = i->description,
+                        .pw_gecos = (char*) strempty(i->description),
 
                         /* "x" means the password is stored in the shadow file */
                         .pw_passwd = (char*) PASSWORD_SEE_SHADOW,