From 2567e09c34ed0966cb929a0e1a3f40c81b09a88b Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Sun, 9 Mar 2014 22:35:45 +0200 Subject: [PATCH] fix alsa device name constraint struct allocation The bug was present in the inital version of the code, commit ebba58c8eef5c2f217b86b293e15de7bb70d9faf There was no memory corruption because while jack_driver_param_value_enum_t is smaller by 72 bytes than jack_driver_param_constraint_desc_t, for enum constraints, the last 240 (on 64bit) bytes are not used. --- linux/alsa/JackAlsaDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/alsa/JackAlsaDriver.cpp b/linux/alsa/JackAlsaDriver.cpp index 0f4acad6..c2b9bd39 100644 --- a/linux/alsa/JackAlsaDriver.cpp +++ b/linux/alsa/JackAlsaDriver.cpp @@ -543,7 +543,7 @@ fill_device( if (*constraint_ptr_ptr == NULL) { - *constraint_ptr_ptr = (jack_driver_param_constraint_desc_t *)calloc(1, sizeof(jack_driver_param_value_enum_t)); + *constraint_ptr_ptr = (jack_driver_param_constraint_desc_t *)calloc(1, sizeof(jack_driver_param_constraint_desc_t)); *array_size_ptr = 0; }