[hackers] [wmii] Don't crash on short send/swap commands on /tag/*/ctl || Kris Maglione

From: <hg_AT_suckless.org>
Date: Sun, 14 Dec 2008 23:35:36 +0000 (UTC)

changeset: 2424:435ba8224d79
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Dec 14 18:35:28 2008 -0500
files: cmd/wmii/message.c
description:
Don't crash on short send/swap commands on /tag/*/ctl

diff -r 12b204c29564 -r 435ba8224d79 cmd/wmii/message.c
--- a/cmd/wmii/message.c Fri Dec 12 14:20:13 2008 -0500
+++ b/cmd/wmii/message.c Sun Dec 14 18:35:28 2008 -0500
@@ -265,6 +265,8 @@
         int base;
         long sign;
 
+ if(s == nil)
+ return false;
         end = s+strlen(s);
         base = getbase(&s, &sign);
         if(sign == 0)
@@ -281,6 +283,8 @@
         int base;
         long sign;
 
+ if(s == nil)
+ return false;
         end = s+strlen(s);
         base = getbase(&s, &sign);
         if(sign < 1)
@@ -328,6 +332,8 @@
          * <column number>
          */
 
+ if(s == nil)
+ return nil;
         if(!strcmp(s, "sel"))
                 return v->sel;
         if(!strcmp(s, "~"))
Received on Sun Dec 14 2008 - 23:35:36 UTC

This archive was generated by hypermail 2.2.0 : Sun Dec 14 2008 - 23:36:04 UTC