From: Guus Sliepen Date: Fri, 12 Nov 2010 10:38:05 +0000 (+0100) Subject: Don't use strlen() on a NULL pointer. X-Git-Tag: release-1.0.14~34 X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=930bf74fbe5ce8363b6cc2ae3a3e960e910e0996 Don't use strlen() on a NULL pointer. A bug introduced in commit 667b1bac77b134cf32c98d5dc25619e8c3303f52 caused tinc to crash on startup. --- diff --git a/src/conf.c b/src/conf.c index 1b8213c4..07279531 100644 --- a/src/conf.c +++ b/src/conf.c @@ -339,7 +339,7 @@ bool read_config_file(avl_tree_t *config_tree, const char *fname) { void read_config_options(avl_tree_t *config_tree, const char *prefix) { list_node_t *node, *next; - size_t prefix_len = strlen(prefix); + size_t prefix_len = prefix ? strlen(prefix) : 0; for(node = cmdline_conf->tail; node; node = next) { config_t *cfg = (config_t *)node->data;