From 664e4effdbd46c141094ba6a6f8decfbf27a4191 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Tue, 17 May 2011 20:38:18 +0200 Subject: [PATCH 1/2] Client: Fill new client with 0. fixes #116 Submitted-by: e-t172 Signed-off-by: Philippe Pepiot --- src/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.c b/src/client.c index 6fb89ff..e20d11d 100644 --- a/src/client.c +++ b/src/client.c @@ -819,7 +819,7 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar) screen_get_sel(); - c = zmalloc(sizeof(Client)); + c = zcalloc(sizeof(Client)); c->win = w; c->screen = selscreen; c->flags = 0; From bfb8658bba32938dc883d42ab7bfa86217136325 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Wed, 6 Jul 2011 13:32:33 +0200 Subject: [PATCH 2/2] Infobar: segfault when client->title is NULL, fixes #132 Signed-off-by: Philippe Pepiot --- src/infobar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infobar.c b/src/infobar.c index b89f5a9..94fc804 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -188,7 +188,7 @@ infobar_draw_selbar(int sc) else if(sel && !infobar[sc].selbar->mapped) barwin_map(infobar[sc].selbar); - if(conf.selbar.maxlength >= 0 && sel) + if(conf.selbar.maxlength >= 0 && sel && sel->title) { str = xcalloc(conf.selbar.maxlength + 4, sizeof(char)); strncpy(str, sel->title, conf.selbar.maxlength);