]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
vipw: use snprintf() rather than sprintf()
authorKarel Zak <kzak@redhat.com>
Tue, 27 Jul 2021 11:30:14 +0000 (13:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Jul 2021 11:30:14 +0000 (13:30 +0200)
login-utils/vipw.c

index f178c8f2a2a6c40ab57dba0a852d4e9bc748657c..8e63efde28b0b2021dbfb33f2b2b14623f99a8cb 100644 (file)
@@ -142,7 +142,7 @@ static void pw_write(void)
 {
        char tmp[FILENAMELEN + 4];
 
-       sprintf(tmp, "%s%s", orig_file, ".OLD");
+       snprintf(tmp, sizeof(tmp), "%s%s", orig_file, ".OLD");
        unlink(tmp);
 
        if (link(orig_file, tmp))