diff options
author | Yorhel <git@yorhel.nl> | 2013-09-27 10:17:06 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2013-09-27 10:17:06 +0200 |
commit | 91ccadf5b96dd3bbd2402615c69d01210e2c1de4 (patch) | |
tree | 1c13747624bd47b56a53b02b44a5695e26eae84e /src/fl_load.c | |
parent | b976e78c802d3f4f57bee6440f8902bd43a20b38 (diff) |
fl_load: Don't allow a <Directory> element inside a <File>
Diffstat (limited to 'src/fl_load.c')
-rw-r--r-- | src/fl_load.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fl_load.c b/src/fl_load.c index f86846d..6dc54ab 100644 --- a/src/fl_load.c +++ b/src/fl_load.c @@ -126,9 +126,12 @@ static void fl_load_token(ctx_t *x, yxml_ret_t r, GError **err) { } else { if(g_ascii_strcasecmp(x->x.elem, "File") == 0) x->state = S_FILEOPEN; - else if(g_ascii_strcasecmp(x->x.elem, "Directory") == 0) - x->state = S_DIROPEN; - else + else if(g_ascii_strcasecmp(x->x.elem, "Directory") == 0) { + if(x->state == S_INFILE) + g_set_error_literal(err, 1, 0, "Invalid <Directory> inside a <File>"); + else + x->state = S_DIROPEN; + } else x->unknown_level++; } break; |