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

index 00d9970aa81245eea1b1b8d1d2fe28bf9f64a489..579902d50ae007f6afddeed85be00abf903ec313 100644 (file)
@@ -70,7 +70,7 @@ static FILE *myopen(char *name, char *mode, int *flag)
        if (!strcmp(name + len - 3, ".gz")) {
                FILE *res;
                char *cmdline = xmalloc(len + 6);
-               sprintf(cmdline, "zcat %s", name);
+               snprintf(cmdline, len + 6, "zcat %s", name);
                res = popen(cmdline, mode);
                free(cmdline);
                *flag = 1;