From 62919eee3ef5fbad678034c21948abed523fa47e Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 20 Dec 2018 02:00:39 +0100 Subject: renderer: fix a (very) unlikely segfault detected by scan-build --- src/blogc/renderer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blogc/renderer.c b/src/blogc/renderer.c index 142aa56..e34007a 100644 --- a/src/blogc/renderer.c +++ b/src/blogc/renderer.c @@ -215,7 +215,7 @@ blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_trie_t *config, bool list break; } current_source = sources; - tmp_source = current_source->data; + tmp_source = current_source != NULL ? current_source->data : NULL; } else if ((0 == strcmp("listing", node->data[0])) || (0 == strcmp("listing_once", node->data[0]))) { @@ -245,7 +245,7 @@ blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_trie_t *config, bool list listing_start = tmp; current_source = sources; } - tmp_source = current_source->data; + tmp_source = current_source != NULL ? current_source->data : NULL; } break; -- cgit v1.2.3-18-g5258