summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Walpen <dev@submerge.ch>2022-01-22 22:32:34 +0100
committerFilipe Coelho <falktx@falktx.com>2022-04-07 15:20:45 +0100
commit84a21a8cb9afe8008efdc0e76f60df52d26fe44c (patch)
treebd8a1a2720b612455e4b7a5a34a0e0b834ca1e1c
parentd8f59c2f804ef29e0db772a3bffda219514ab1c3 (diff)
downloadjack2-84a21a8cb9afe8008efdc0e76f60df52d26fe44c.tar.gz
Bad semaphore allocation in midi_latency_test.
The code did a pointer-sized heap allocation instead of the actual size of a semaphore struct sem_t. This could result in heap memory corruption when handling the semaphore. Found by llvm scan-build.
-rw-r--r--example-clients/midi_latency_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/example-clients/midi_latency_test.c b/example-clients/midi_latency_test.c
index 1a6988c0..b70d7243 100644
--- a/example-clients/midi_latency_test.c
+++ b/example-clients/midi_latency_test.c
@@ -163,7 +163,7 @@ create_semaphore(int id)
semaphore = NULL;
}
#else
- semaphore = malloc(sizeof(semaphore_t));
+ semaphore = malloc(sizeof(sem_t));
if (semaphore != NULL) {
if (sem_init(semaphore, 0, 0)) {
free(semaphore);