]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
a52: fix possible string overflow and double space
authorJaroslav Kysela <perex@perex.cz>
Wed, 16 Jun 2021 08:36:17 +0000 (10:36 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 16 Jun 2021 08:36:17 +0000 (10:36 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
a52/pcm_a52.c

index a6b04a1acddcadd515ea366f6638a848422fee31..e48489e4721c9238a4e18cc57d8108142f1900f8 100644 (file)
@@ -973,7 +973,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52)
        unsigned int bitrate = 448;
        unsigned int channels = 6;
        snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
-       char devstr[128], tmpcard[8];
+       char devstr[128], tmpcard[16];
        struct a52_ctx *rec;
        
        if (stream != SND_PCM_STREAM_PLAYBACK) {
@@ -1116,7 +1116,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52)
 
        if (! pcm_string || pcm_string[0] == '\0') {
                snprintf(devstr, sizeof(devstr),
-                        "iec958:{AES0 0x%x AES1 0x%x AES2 0x%x AES3 0x%x %s%s}",
+                        "iec958:{AES0 0x%x AES1 0x%x AES2 0x%x AES3 0x%x%s%s}",
                         IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO |
                         IEC958_AES0_CON_NOT_COPYRIGHT,
                         IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,