projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e73851
)
configfile.c: Ignore registered undefined config keys.
author
Sebastian Harl
<sh@tokkee.org>
Fri, 5 Dec 2008 16:22:53 +0000
(17:22 +0100)
committer
Sebastian Harl
<sh@tokkee.org>
Sat, 6 Dec 2008 08:58:48 +0000
(09:58 +0100)
If a registered config key equals NULL, it is now ignored. Before, this would
cause a segfault. As this has happened a few times in the past, we not handle
it sanely.
src/configfile.c
patch
|
blob
|
history
diff --git
a/src/configfile.c
b/src/configfile.c
index
b1030fe
..
bb57ca2
100644
(file)
--- a/
src/configfile.c
+++ b/
src/configfile.c
@@
-155,7
+155,8
@@
static int cf_dispatch (const char *type, const char *orig_key,
for (i = 0; i < cf_cb->keys_num; i++)
{
- if (strcasecmp (cf_cb->keys[i], key) == 0)
+ if ((cf_cb->keys[i] != NULL)
+ && (strcasecmp (cf_cb->keys[i], key) == 0))
{
ret = (*cf_cb->callback) (key, value);
break;