Infobar: segfault when client->title is NULL, fixes #132

Signed-off-by: Philippe Pepiot <phil@philpep.org>
This commit is contained in:
Philippe Pepiot 2011-07-06 13:32:33 +02:00
parent 664e4effdb
commit bfb8658bba

View File

@ -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);