aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-21 15:58:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-21 15:58:53 +0100
commit40eb7a316af28b72c7a07042d6b8b7b1a06792b5 (patch)
tree413cc79562b1fe3d1a9fb9addc56a5768c7671c0 /src
parent91d9f33e86b39737617d2d3fbc016673ba3b8cb1 (diff)
downloadrspamd-40eb7a316af28b72c7a07042d6b8b7b1a06792b5.tar.gz
rspamd-40eb7a316af28b72c7a07042d6b8b7b1a06792b5.zip
Fix whitespace parsing for rcl arrays.
Diffstat (limited to 'src')
-rw-r--r--src/rcl/rcl_parser.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/rcl/rcl_parser.c b/src/rcl/rcl_parser.c
index 90202b6c5..797c8850c 100644
--- a/src/rcl/rcl_parser.c
+++ b/src/rcl/rcl_parser.c
@@ -573,7 +573,6 @@ rspamd_cl_parse_key (struct rspamd_cl_parser *parser,
else {
/* Invalid identifier */
rspamd_cl_set_err (chunk, RSPAMD_CL_ESYNTAX, "key must begin with a letter", err);
- assert (0);
return FALSE;
}
}
@@ -724,20 +723,22 @@ rspamd_cl_parse_value (struct rspamd_cl_parser *parser, struct rspamd_cl_chunk *
{
const guchar *p, *c;
struct rspamd_cl_stack *st;
- rspamd_cl_object_t *obj;
+ rspamd_cl_object_t *obj = NULL;
p = chunk->pos;
while (p < chunk->end) {
- if (parser->stack->obj->type == RSPAMD_CL_ARRAY) {
- /* Object must be allocated */
- obj = rspamd_cl_object_new ();
- parser->cur_obj = obj;
- LL_PREPEND (parser->stack->obj->value.ov, parser->cur_obj);
- }
- else {
- /* Object has been already allocated */
- obj = parser->cur_obj;
+ if (obj == NULL) {
+ if (parser->stack->obj->type == RSPAMD_CL_ARRAY) {
+ /* Object must be allocated */
+ obj = rspamd_cl_object_new ();
+ parser->cur_obj = obj;
+ LL_PREPEND (parser->stack->obj->value.ov, parser->cur_obj);
+ }
+ else {
+ /* Object has been already allocated */
+ obj = parser->cur_obj;
+ }
}
c = p;
switch (*p) {