From 85b1f4edc79509162c36ec23fecc8d75f82ac9a7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 12 Jun 2020 11:33:44 +0100 Subject: [PATCH] Fix crash with libjack port search requests Signed-off-by: falkTX --- source/libjack/libjack_port-searching.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/libjack/libjack_port-searching.cpp b/source/libjack/libjack_port-searching.cpp index 81005f344..69f389a37 100644 --- a/source/libjack/libjack_port-searching.cpp +++ b/source/libjack/libjack_port-searching.cpp @@ -1,6 +1,6 @@ /* * Carla JACK API for external applications - * Copyright (C) 2016-2019 Filipe Coelho + * Copyright (C) 2016-2020 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -56,7 +56,7 @@ const char** jack_get_ports(jack_client_t* client, const char* a, const char* b, if (flags == 0 || (flags & (JackPortIsInput|JackPortIsOutput)) == (JackPortIsInput|JackPortIsOutput)) { - if (const char** const ret = (const char**)calloc(numIns+numOuts, sizeof(const char*))) + if (const char** const ret = (const char**)calloc(numIns+numOuts+1, sizeof(const char*))) { uint i=0; for (uint j=0; j