]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: fix potential buffer overwrite
authorMingjie Shen <shen497@purdue.edu>
Wed, 6 Dec 2023 21:49:26 +0000 (16:49 -0500)
committerJaroslav Kysela <perex@perex.cz>
Fri, 8 Dec 2023 18:56:45 +0000 (19:56 +0100)
The 'call to sprintf' operation on line 413 requires 21 bytes
but the destination is only 16 bytes.

Fixes: https://github.com/alsa-project/alsa-utils/pull/247
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/alsactl.c

index a854c0bdc16f331e11b3ec15eb04ba0271dd84d4..8ad991a0f36bc1cfebcee54fd2507b83f43f377b 100644 (file)
@@ -242,7 +242,7 @@ int main(int argc, char *argv[])
        char *cfgfile = SYS_ASOUNDRC;
        char *initfile = DATADIR "/init/00main";
        char *pidfile = SYS_PIDFILE;
-       char *cardname, ncardname[16];
+       char *cardname, ncardname[21];
        char *cmd;
        char *const *extra_args;
        const char *const *tmp;