Subject: FVWM: [patch] modules crash when window title is very long

From: Mikhail Kruk <[email-masked]>
Date: Mon, 29 Apr 2002 03:45:33 -0400 (EDT)

Hi,
subj pretty much says it all, when a window tries to set a very long 
title, winlist, taskbar and pager all crash. I think the attached patch 
solves it (FvwmPacketMaxSize was used incorrectly vs FvwmPacketSize_byte).
Please let me know if I'm right, it's my first attempt to contribute to 
my favorite window manager and I'm a bit excited :)

Thanks!
*** module_interface.c	Mon Apr 29 03:40:57 2002
--- module_interface.c.orig	Mon Apr 29 03:25:24 2002
***************
*** 1101,1108 ****
    *len =
      FvwmPacketHeaderSize + num + (strlen(name) / sizeof(unsigned long)) + 1;
    /* truncate long packets */
!   if (*len > FvwmPacketMaxSize)
!     *len = FvwmPacketMaxSize;
  
    body = (unsigned long *)safemalloc(*len * sizeof(unsigned long));
    body[*len-1] = 0; /* Zero out end of memory to avoid uninit memory access. */
--- 1101,1108 ----
    *len =
      FvwmPacketHeaderSize + num + (strlen(name) / sizeof(unsigned long)) + 1;
    /* truncate long packets */
!   if (*len > FvwmPacketMaxSize_byte)
!     *len = FvwmPacketMaxSize_byte;
  
    body = (unsigned long *)safemalloc(*len * sizeof(unsigned long));
    body[*len-1] = 0; /* Zero out end of memory to avoid uninit memory access. */