From 0061ddd6bea5ab413e8a576f8054520d62ddc367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Tue, 16 Feb 2021 14:56:17 +0100 Subject: [PATCH] audioconvert: Fix buffer overflow This was introduced by commit c160a063b9b8f51940f80d92c8cfc477500a4d20 --- spa/plugins/audioconvert/splitter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 86b66d93c..9844596a3 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -158,12 +158,12 @@ static int init_port(struct impl *this, enum spa_direction direction, port->id = port_id; if (position < SPA_N_ELEMENTS(spa_type_audio_channel)) { - snprintf(port->position, 16, "%s", + snprintf(port->position, 7, "%s", spa_debug_type_short_name(spa_type_audio_channel[position].name)); } else if (position >= SPA_AUDIO_CHANNEL_CUSTOM_START) { - snprintf(port->position, 16, "AUX%d", position - SPA_AUDIO_CHANNEL_CUSTOM_START); + snprintf(port->position, 7, "AUX%d", position - SPA_AUDIO_CHANNEL_CUSTOM_START); } else { - snprintf(port->position, 16, "UNK"); + snprintf(port->position, 7, "UNK"); } port->info_all = SPA_PORT_CHANGE_MASK_FLAGS |