aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-12-20 02:00:39 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-12-20 02:00:39 +0100
commit62919eee3ef5fbad678034c21948abed523fa47e (patch)
treecb5873264ea406f120e4362f7dbdee8bebba844b
parent3c71b61ac4f2919bceb9e1d1b5da5dc05a6e2402 (diff)
downloadblogc-62919eee3ef5fbad678034c21948abed523fa47e.tar.gz
blogc-62919eee3ef5fbad678034c21948abed523fa47e.tar.bz2
blogc-62919eee3ef5fbad678034c21948abed523fa47e.zip
renderer: fix a (very) unlikely segfault detected by scan-build
-rw-r--r--src/blogc/renderer.c4
1 files 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;