vban: truncate sess.name when too large

This commit is contained in:
Wim Taymans 2025-08-01 18:16:39 +02:00
parent 8614fc45f8
commit 35b3c8c279

View file

@ -298,7 +298,7 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
impl->header.format_bit = impl->format_info->format_bit;
if ((str = pw_properties_get(props, "sess.name")) == NULL)
str = "Stream1";
strcpy(impl->header.stream_name, str);
snprintf(impl->header.stream_name, sizeof(impl->header.stream_name), "%s", str);
break;
case SPA_MEDIA_SUBTYPE_control:
impl->stream_info = impl->info;
@ -319,7 +319,7 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
impl->header.format_bit = impl->format_info->format_bit;
if ((str = pw_properties_get(props, "sess.name")) == NULL)
str = "Midi1";
strcpy(impl->header.stream_name, str);
snprintf(impl->header.stream_name, sizeof(impl->header.stream_name), "%s", str);
break;
default:
spa_assert_not_reached();