From 5a441cd6defcb5e11183f933ed4957311a9ed853 Mon Sep 17 00:00:00 2001 From: Johannes Holmberg Date: Wed, 16 Sep 2015 21:19:40 -0400 Subject: [PATCH] Fix a buffer overflow (how did this ever work?) --- wmix/misc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wmix/misc.c b/wmix/misc.c index 9120bd9..f26170e 100644 --- a/wmix/misc.c +++ b/wmix/misc.c @@ -42,7 +42,6 @@ typedef struct { } MRegion; MRegion mr[16]; - /* Converts separate left and right channel volumes (each in [0, 1]) to * volume and balance values. (Volume is in [0, 1], balance is in [-1, 1]) */ @@ -119,7 +118,7 @@ void create_pid_file(void) if (home == NULL) return; - pid = calloc(1, strlen(home) + 10); + pid = malloc(strlen(home) + 11); sprintf(pid, "%s/.wmix.pid", home); fp = fopen(pid, "w"); if (fp) {