--- fvwm/modules/FvwmButtons/button.c +++ fvwm/modules/FvwmButtons/button.c @@ -490,13 +490,15 @@ void alloc_buttonlist(button_info *ub,int num) if(num>=ub->c->allocated_buttons) { old=ub->c->allocated_buttons; - if(num(old+32)) /* test for numc->allocated_buttons<=num) + { ub->c->allocated_buttons+=32; + if(old>ub->c->allocated_buttons) + { + fprintf(stderr,"%s: Too many buttons, integer overflow\n",MyName); + exit(1); + } + } bb=(button_info**) mymalloc(ub->c->allocated_buttons*sizeof(button_info*)); for(i=old;ic->allocated_buttons;i++)