Subject: FvwmTaskBar fix

From: Suzanne Skinner <[email-masked]>
Date: Fri, 4 Oct 2002 15:03:59 -0400

The attached patch fixes a number of instances in Start.c where space was
malloced before calling CopyString (which mallocs its own space).

Suzanne

-- 
[email-masked] - http://www.igs.net/~tril/
diff -ur fvwm-20021004-orig/modules/ChangeLog fvwm-20021004/modules/ChangeLog
--- fvwm-20021004-orig/modules/ChangeLog	Fri Oct  4 13:33:40 2002
+++ fvwm-20021004/modules/ChangeLog	Fri Oct  4 14:48:55 2002
@@ -1,3 +1,9 @@
+2002-10-04  Suzanne Skinner  <[email-masked]>
+
+	* FvwmTaskBar/Start.c (StartButtonParseConfig):
+	Fixed a number of cases where space was malloced before calling
+	CopyString (which mallocs its own space)
+
 2002-10-04  Mikhael Goikhman  <[email-masked]>
 
 	* FvwmTaskBar/Start.c:
diff -ur fvwm-20021004-orig/modules/FvwmTaskBar/Start.c fvwm-20021004/modules/FvwmTaskBar/Start.c
--- fvwm-20021004-orig/modules/FvwmTaskBar/Start.c	Fri Oct  4 13:33:40 2002
+++ fvwm-20021004/modules/FvwmTaskBar/Start.c	Fri Oct  4 14:47:35 2002
@@ -97,7 +97,6 @@
       /* declarin caption twice, ignore */
       break;
     }
-    First_Start_Button->buttonCaption = safemalloc(strlen(rest) * sizeof(char));
     CopyString(&(First_Start_Button->buttonCaption), rest);    
     break;
   case 1: /* StartMenu */
@@ -121,7 +120,6 @@
       /* declaring command twice, ignore */
       break;
     }
-    First_Start_Button->buttonCommand = safemalloc(strlen(rest) * sizeof(char));
     CopyString(&(First_Start_Button->buttonCommand), rest);   
     break;
   case 2: /* StartIcon */
@@ -145,7 +143,6 @@
       /* declaring icon twice, ignore */
       break;
     }
-    First_Start_Button->buttonIconFileName = safemalloc(strlen(rest) * sizeof(char));
     CopyString(&(First_Start_Button->buttonIconFileName), rest);   
    break;
   case 3: /* StartCommand */
@@ -169,7 +166,6 @@
       /* declaring icon twice, ignore */
       break;
     }
-    First_Start_Button->buttonStartCommand = safemalloc(strlen(rest) * sizeof(char));
     CopyString(&(First_Start_Button->buttonStartCommand), rest);   
     break;
   case 4:
@@ -197,7 +193,6 @@
 	tokens[j+1] = tokens[k] + ((sizeof(char))*5);
 	while(*(tokens[j+1])==' ')
 	  tokens[j+1]+=sizeof(char);
-	Last_Start_Button->buttonCaption = (char *) safemalloc(sizeof(char) * (strlen(tokens[j+1])));
         CopyString(&(Last_Start_Button->buttonCaption), tokens[j+1]);
 	titleRecorded=1;
       }	
@@ -206,7 +201,6 @@
 	tokens[j+1] = tokens[k] + ((sizeof(char))*4);
 	while(*(tokens[j+1])==' ')
 	  tokens[j+1]+=sizeof(char);
-	Last_Start_Button->buttonIconFileName = (char *) safemalloc(sizeof(char) * (strlen(tokens[j+1])));
 	CopyString(&(Last_Start_Button->buttonIconFileName),tokens[j+1] );
 	iconRecorded = 1;
       }
@@ -215,7 +209,6 @@
 	tokens[j+1] = tokens[k] + ((sizeof(char))*6);
 	while(*(tokens[j+1])==' ')
 	  tokens[j+1]+=sizeof(char);
-	Last_Start_Button->buttonCommand = (char *) safemalloc(sizeof(char) * (strlen(tokens[j+1])));
 	CopyString(&(Last_Start_Button->buttonCommand), tokens[j+1]);
 	actionRecorded = 1;
       }

---

From: Ben Mathews <[email-masked]>
Date: Fri, 04 Oct 2002 16:14:11 -0400

I did not know tha copy string allocated its own space.  Anywhere 
additional calls that I added probably also have this problem.  I will 
look at it closely this weekend.

Ben Mathews

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 4 Oct 2002 21:22:13 +0000

Suzanne, do you prefer to continue to send patches or use cvs commits?

At least I, Dominik and Olivier applied your different patches since
January, so I think you have a quorum to get write permission.

So, if you prefer to use cvs and there are no objections, you may follow
the instructions in cvs.html and contact Jason.

Regards,
Mikhael.

---

From: Suzanne Skinner <[email-masked]>
Date: Sat, 5 Oct 2002 01:45:53 -0400

> Suzanne, do you prefer to continue to send patches or use cvs commits?

CVS write access would be great. Then I can commit straightforward bugfixes as
I run across them.

> the instructions in cvs.html and contact Jason.

Will do.

Suzanne

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 6 Oct 2002 00:16:40 +0200

> CVS write access would be great. Then I can commit straightforward bugfixes as

So, I'm gone for a few days and people get write access?  I should 
take a break more often :-)  Nice to have you on board, Suzanne.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]