]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: check block text for NULL
authorTony Crisci <tony@dubstepdish.com>
Tue, 24 Mar 2015 09:45:20 +0000 (05:45 -0400)
committerTony Crisci <tony@dubstepdish.com>
Tue, 24 Mar 2015 09:45:20 +0000 (05:45 -0400)
Add a null check to `full_text` and `short_text` for a block before
setting the markup property to avoid a segfault.

i3bar/src/child.c

index 402e6351bd3fd085134278c066b4a50d7ddf9307..a461c9313bf9f16a2391e5e03f2ff3daca4cf408 100644 (file)
@@ -265,7 +265,9 @@ static int stdin_end_map(void *context) {
     }
 
     i3string_set_markup(new_block->full_text, new_block->is_markup);
-    i3string_set_markup(new_block->short_text, new_block->is_markup);
+
+    if (new_block->short_text != NULL)
+        i3string_set_markup(new_block->short_text, new_block->is_markup);
 
     TAILQ_INSERT_TAIL(&statusline_buffer, new_block, blocks);
     return 1;