alsactl: fix potential buffer overwrite

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>
This commit is contained in:
Mingjie Shen 2023-12-06 16:49:26 -05:00 committed by Jaroslav Kysela
parent 8f3d84ba19
commit 004d085c67

View 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;