From 7884ff82db196ae0572b481e126ef630ab2f667e Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Sat, 20 Aug 2022 09:41:02 +0300 Subject: [PATCH] jack: Include NULL in return value of jack_client_name_size() This fixes an assertion failure in PortAudio's JACK backend when the monitor client name is longer than than JACK_CLIENT_NAME_SIZE. --- pipewire-jack/src/pipewire-jack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 826755026..4202a5f6b 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -3584,8 +3584,9 @@ char *jack_get_internal_client_name (jack_client_t *client, SPA_EXPORT int jack_client_name_size (void) { - pw_log_trace("%d", JACK_CLIENT_NAME_SIZE); - return JACK_CLIENT_NAME_SIZE; + /* The JACK API specifies that this value includes the final NULL character. */ + pw_log_trace("%d", JACK_CLIENT_NAME_SIZE+1); + return JACK_CLIENT_NAME_SIZE+1; } SPA_EXPORT