aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2010-11-12 15:34:33 +0100
committerTobias Brunner <tobias@strongswan.org>2010-12-03 17:40:52 +0100
commit67c464d1a96b7956e27d3be53004ed26e2227781 (patch)
tree1ed98713f72c016bbba4c275e2914ab6b84ee9d5 /src
parentdc46fd58798886bd35da986e9a5ed5a862f387d6 (diff)
downloadstrongswan-67c464d1a96b7956e27d3be53004ed26e2227781.tar.bz2
strongswan-67c464d1a96b7956e27d3be53004ed26e2227781.tar.xz
Skip values and sections without key.
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/settings.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstrongswan/settings.c b/src/libstrongswan/settings.c
index 558259d12..ccff84f25 100644
--- a/src/libstrongswan/settings.c
+++ b/src/libstrongswan/settings.c
@@ -644,6 +644,12 @@ static bool parse_section(linked_list_t *files, char *file, int level,
if (parse(text, "\t ", "}", "{", &inner))
{
section_t *sub;
+ if (!strlen(key))
+ {
+ DBG1(DBG_LIB, "skipping section without name in '%s'",
+ section->name);
+ continue;
+ }
if (section->sections->find_first(section->sections,
(linked_list_match_t)section_find,
(void**)&sub, key) != SUCCESS)
@@ -673,6 +679,12 @@ static bool parse_section(linked_list_t *files, char *file, int level,
if (parse(text, "\t ", "\n", NULL, &value))
{
kv_t *kv;
+ if (!strlen(key))
+ {
+ DBG1(DBG_LIB, "skipping value without key in '%s'",
+ section->name);
+ continue;
+ }
if (section->kv->find_first(section->kv,
(linked_list_match_t)kv_find,
(void**)&kv, key) != SUCCESS)