diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-07-18 13:48:08 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-07-18 17:54:17 +0200 |
commit | c6e486ffb2e5a3a3e8f34fb24a6f6f2683cf010b (patch) | |
tree | 921d7db921437c6730154814f7b85e771b87f8ea /sound/pci/rme9652 | |
parent | 24d220773139ae03fc7bda692c5f6335ea457059 (diff) |
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>
Diffstat (limited to 'sound/pci/rme9652')
0 files changed, 0 insertions, 0 deletions