linux/sound/pci/mixart
Arnd Bergmann c6e486ffb2 ALSA: mixart: fix string overflow warning
Using a temporary string produces warnings about a possible overflow
in sprintf:

sound/pci/mixart/mixart.c: In function 'snd_mixart_probe':
sound/pci/mixart/mixart.c:1353:28: error: ' [PCM #' directive writing 7 bytes into a region of size between 1 and 32 [-Werror=format-overflow=]
   sprintf(card->shortname, "%s [PCM #%d]", mgr->shortname, i);
                            ^~~~~~~~~~~~~~
sound/pci/mixart/mixart.c:1353:28: note: using the range [-2147483648, 2147483647] for directive argument
sound/pci/mixart/mixart.c:1353:3: note: 'sprintf' output between 10 and 51 bytes into a destination of size 32
   sprintf(card->shortname, "%s [PCM #%d]", mgr->shortname, i);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/pci/mixart/mixart.c:1354:27: error: ' [PCM #' directive writing 7 bytes into a region of size between 1 and 80 [-Werror=format-overflow=]
   sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i);
                           ^~~~~~~~~~~~~~
sound/pci/mixart/mixart.c:1354:27: note: using the range [-2147483648, 2147483647] for directive argument
sound/pci/mixart/mixart.c:1354:3: note: 'sprintf' output between 10 and 99 bytes into a destination of size 80

Skipping the intermediate, we can get gcc to see that it is in fact
safe here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-07-18 17:54:17 +02:00
..
Makefile [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-16 16:51:18 +02:00
mixart_core.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
mixart_core.h ALSA: mixart: Use nonatomic PCM ops 2014-09-15 15:52:09 +02:00
mixart_hwdep.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
mixart_hwdep.h ALSA: sound/mixart: avoid redefining {readl,write}_{le,be} accessors 2010-11-11 02:02:20 +01:00
mixart_mixer.c ALSA: mixart: constify snd_kcontrol_new structures 2017-05-21 09:08:15 +02:00
mixart_mixer.h
mixart.c ALSA: mixart: fix string overflow warning 2017-07-18 17:54:17 +02:00
mixart.h ALSA: mixart: fix string overflow warning 2017-07-18 17:54:17 +02:00