The WINGs-function wtokensplit does not set argv to NULL if no string has been
split - instead argc is set to 0.

You can only observe this issue if you compile Window Maker without any
optimization:

compile Window Maker with CFLAGS=""
run Window Maker and save a session
change session-file and replace a 'command xyz' line with 'command " "'
restart Window Maker
watch "Fatal error"-message

Author: Tobias Stoeckmann
Retrieved from: http://paldium.homeunix.org/tobias/wmaker/
Submitted by Gilbert Ashley <[email protected]>


2 files changed, 2 insertions(+), 2 deletions(-)
src/dock.c    |    2 +-
src/session.c |    2 +-


# HG changeset patch
# User John H. Robinson, IV <[email protected]>
# Date 1229206923 28800
# Node ID e40ed47595749488fd4a46cac470c34e033833b4
# Parent  38d48fca2e9692b3e2ba0d2d2b4b2d05e9a4eda3
Check for argc==0 when calling wtokensplit()

The WINGs-function wtokensplit does not set argv to NULL if no string has been
split - instead argc is set to 0.

You can only observe this issue if you compile Window Maker without any
optimization:

compile Window Maker with CFLAGS=""
run Window Maker and save a session
change session-file and replace a 'command xyz' line with 'command " "'
restart Window Maker
watch "Fatal error"-message

Author: Tobias Stoeckmann
Retrieved from: http://paldium.homeunix.org/tobias/wmaker/
Submitted by Gilbert Ashley <[email protected]>

diff --git a/src/dock.c b/src/dock.c
--- a/src/dock.c
+++ b/src/dock.c
@@ -2977,7 +2977,7 @@
 
     wtokensplit(cmdline, &argv, &argc);
 
-    if (argv==NULL) {
+    if (!argc) {
         if (cmdline)
             wfree(cmdline);
         if (state)
diff --git a/src/session.c b/src/session.c
--- a/src/session.c
+++ b/src/session.c
@@ -381,7 +381,7 @@
 
     wtokensplit(command, &argv, &argc);
 
-    if (argv==NULL) {
+    if (!argc) {
         return 0;
     }
 

Reply via email to