JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Be more careful with pointers in swapwin
authorMarco Peereboom <marco@conformal.com>
Fri, 9 Oct 2009 18:26:41 +0000 (18:26 +0000)
committerMarco Peereboom <marco@conformal.com>
Fri, 9 Oct 2009 18:26:41 +0000 (18:26 +0000)
scrotwm.c

index ad295f7..16363f8 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -52,7 +52,7 @@
 
 static const char      *cvstag = "$scrotwm$";
 
 
 static const char      *cvstag = "$scrotwm$";
 
-#define        SWM_VERSION     "0.9.11"
+#define        SWM_VERSION     "0.9.12"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1553,6 +1553,8 @@ swapwin(struct swm_region *r, union arg *args)
                        else
                                return;
                 }
                        else
                                return;
                 }
+               if (target == NULL || source == NULL)
+                       return;
                source->ws->focus_prev = target;
                TAILQ_REMOVE(wl, target, entry);
                TAILQ_INSERT_BEFORE(source, target, entry);
                source->ws->focus_prev = target;
                TAILQ_REMOVE(wl, target, entry);
                TAILQ_INSERT_BEFORE(source, target, entry);