[PATCH 1/8] Fix a buffer overflow (how did this ever work?)

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
From: Johannes Holmberg <[email protected]>

---
 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) {
-- 
2.1.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.