diff -r 740cfd9dd443 -r 28433f06d5ee src/server/daemon/config.c --- a/src/server/daemon/config.c Sun Jun 30 15:11:48 2013 +0200 +++ b/src/server/daemon/config.c Mon Jul 01 18:05:13 2013 +0200 @@ -706,7 +706,7 @@ // add objects conf->nobj = ucx_dlist_size(cfg->objects); - conf->objects = pool_calloc(pool, 1, sizeof(httpd_object*)); + conf->objects = pool_calloc(pool, conf->nobj, sizeof(httpd_object*)); UcxDlist *objlist = cfg->objects; int i = 0; @@ -727,16 +727,21 @@ httpd_object *obj = object_new(pool, name); obj->path = NULL; - conf->objects[i] = obj; // TODO: beyond array bounds write + conf->objects[i] = obj; // add directives for(int i=0;i<6;i++) { UcxDlist *dirs = cob->directives[i]; while(dirs != NULL) { ConfigDirective *cfgdir = dirs->data; - + directive *d = pool_malloc(pool, sizeof(directive)); - d->cond = NULL; + if(cfgdir->condition) { + sstr_t expr = cfgdir->condition->param_str; + d->cond = condition_from_str(pool, expr.ptr, expr.length); + } else { + d->cond = NULL; + } d->param = pblock_create_pool(pool, 8); // add params