Subject: coredump in FvwmButtons

From: Brad Giaccio <[email-masked]>
Date: Fri, 12 Mar 1999 13:29:36 -0500

There was a change to main between revision 1.27 and 1.28 here is the
pertinent part of the diff against FvwmButtons.c the real problem is
in not setting parent to NULL. in MakeContainer it is assumed that if
parent != NULL then we can access all of the parents fields, which
it can't because they haven't been allocated the specific dump is in
MakeContainer where it tries to access b->parent->c which is NULL.

@@ -554,12 +555,8 @@
   oldErrorHandler=XSetErrorHandler(myErrorHandler);
 
   UberButton=(button_info*)mymalloc(sizeof(button_info));
-  UberButton->flags=0;
-  UberButton->parent=NULL;
   UberButton->BWidth=1;
   UberButton->BHeight=1;
-  UberButton->font = NULL;
-  UberButton->font_string = NULL;
   MakeContainer(UberButton);
 
   dpw = DisplayWidth(Dpy,screen);

The fix is simplly to readd these lines of code I was just wondering why
they were removed the log for this file mentions a coredump fix but I
don't know if this was it or if that comment referred to another line
change.

Here is the fix against current CVS
 -z3 diff FvwmButtons.c
Index: FvwmButtons.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmButtons/FvwmButtons.c,v
retrieving revision 1.29
diff -u -B -b -r1.29 FvwmButtons.c
--- FvwmButtons.c       1999/03/12 17:37:25     1.29
+++ FvwmButtons.c       1999/03/12 18:27:37
@@ -556,8 +556,12 @@
   oldErrorHandler=XSetErrorHandler(myErrorHandler);
 
   UberButton=(button_info*)mymalloc(sizeof(button_info));
+  UberButton->flags=0; 
+  UberButton->parent=NULL;
   UberButton->BWidth=1;
   UberButton->BHeight=1;
+  UberButton->font = NULL;
+  UberButton->font_string = NULL;
   MakeContainer(UberButton);
 
   dpw = DisplayWidth(Dpy,screen);

--
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]