Subject: Massive style line core dump

From: Tim Phipps <[email-masked]>
Date: Fri, 11 Feb 2000 15:03:28 GMT

Configuration Information [Automatically generated, do not change]:
uname output: SunOS tazmo 5.6 Generic_105181-15 sun4u sparc SUNW,Ultra-4
Compiler: gcc
Compilation CFLAGS: -g -O2
prefix: /home/tim
sysconfdir: /home/tim/etc
libexecdir: /home/tim/libexec

FVWM Version: 2.3.14
FVWM_CONFIGDIR: unset
FVWM_MODULEDIR: /home/tim/libexec/fvwm/2.3.14
FVWM_USERHOME: /home/tim/.X

Description:
        I accidentally forgot to quote the * when I typed
FvwmCommand Style * BackingStore
	and got a core dump.

(gdb) where
#0  ProcessNewStyle (eventp=0x6f7dc, w=2415919103, tmp_win=0x0, context=1048576,
    action=0x126388 "", Module=0x200000) at style.c:2153
#1  0x3ea54 in ExecuteFunction (
    Action=0x125fa0 "style CVS ConfigFvwmDefaults ConfigFvwmSetup Makefile Makefile.am Makefile.in add_window.c add_window.h add_window.o bindings.c bindings.h bindings.o borders.c borders.h borders.o builtins.c builtins."..., tmp_win=0x0, eventp=0x6f7dc, context=8,
    Module=2, expand_cmd=1204134) at functions.c:857
#2  0x3c240 in HandleModuleInput (w=0, channel=2, expect=0x0) at module_interface.c:613
#3  0x2fd94 in My_XNextEvent (dpy=0x8, event=0x2) at events.c:2294
#4  0x2cab4 in HandleEvents () at events.c:244
#5  0x340d4 in main (argc=447488, argv=0x6fc00) at fvwm.c:710

--
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: Dominik Vogt <[email-masked]>
Date: Fri, 11 Feb 2000 17:17:48 +0100

> FvwmCommand Style * BackingStore

BTW, you have to quote the whole string, not just the *.

> #5  0x340d4 in main (argc=447488, argv=0x6fc00) at fvwm.c:710

Fixed.  This was caused by a buffer overflow in fvwm_msg.  I have
doubled the buffer size (from 1024 to 2046).  But still this can
happen again.  How much effort/overhead would it be to provide
snprintf and vsnprintf functions via configure (if necessary)?

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [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]

---

From: "Paul D. Smith" <[email-masked]>
Date: 11 Feb 2000 12:28:58 -0500

%% Dominik Vogt <[email-masked]> writes:

  dv> Fixed.  This was caused by a buffer overflow in fvwm_msg.  I have
  dv> doubled the buffer size (from 1024 to 2046).  But still this can
  dv> happen again.  How much effort/overhead would it be to provide
  dv> snprintf and vsnprintf functions via configure (if necessary)?

Well, we'd have to provide alternate implementations for systems that
didn't have them.  The infrastructure for doing things like this is
there and simple to use (most GNU packages now come with a "lib"
subdirectory that contains all kinds of portable-but-not-everywhere
functions and there're simple facilities in autoconf/automake for adding
those in to a given build).

However, snprintf()/vsnprintf() is a pretty complex function; I'm not
sure if there are "stand-alone" implementations of them for GNU tools or
not.  Usually they're tied in with all the other *printf() functions and
can be difficult to extract.  I know, for example, that the FreeBSD
implementations are very co-dependent this way.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
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: "Eddy J. Gurney" <[email-masked]>
Date: Fri, 11 Feb 2000 12:35:59 -0500

On Feb 11 at 12:28, Paul D. Smith wrote:
,--
| However, snprintf()/vsnprintf() is a pretty complex function; I'm not
| sure if there are "stand-alone" implementations of them for GNU tools or
| not.
`--
The `mutt' package contains stand-alone [v]snprintf() functions. I don't
know if they are fully C9X-compliant, but they would probably suffice.
(C9X specifies that the total length of the string, regardless of the buffer
size, needs to be returned by the functions, and that it is acceptable to
pass in a NULL buffer pointer and/or a zero length in order to precompute
the length of the formatted string.) I think the `mutt' variants are derived
from the `samba' source if I remember correctly...