From 84d30e25e2ccff015053e7fdcdb281ca85b9b105 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Sun, 31 Jul 2011 19:03:23 +0200 Subject: [PATCH] Status: securize if in statustext_mouse --- src/status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/status.c b/src/status.c index 783df79..6659f7f 100644 --- a/src/status.c +++ b/src/status.c @@ -45,12 +45,12 @@ void statustext_mouse(char *str, Geo area, Window win) { StatusMouse *sm = NULL; - int i = 0, button = 1; + int i = 0, button = 1, n; char cmd[256] = { 0 }; char func[64] = { 0 }; for(; i < strlen(str); ++i) - if(sscanf(&str[i], "(%d;%64[^;];%256[^)])", &button, func, cmd) >= 2) + if((n = sscanf(&str[i], "(%d;%64[^;];%256[^)])", &button, func, cmd) >= 2) && n <= 3) { sm = zcalloc(sizeof(StatusMouse)); sm->button = button;