]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Catch missing contract parameters in allocator
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 10 Aug 2009 16:17:06 +0000 (18:17 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 10 Aug 2009 16:19:25 +0000 (18:19 +0200)
fwp/lib/frsh_fwp/fwp_fra.c

index 5f41231ad8f9aedb1b407349a3b7c2ba00ee8e49..31559cc12ca8187b9e6243ed0e5b5a96500b260a 100644 (file)
@@ -71,6 +71,8 @@ static int create_vres(fres_vres_t *vres, void *priv)
        /* Prepare vres parameters */
        basic = fres_contract_get_basic(vres->new);
        fwp_sched = fres_contract_get_block(vres->new, FRES_BLOCK_FWP_SCHED);
+       if (!fwp_sched)
+               return FRES_ERR_NEEDS_MORE_DATA_IN_CONTRACT;
 
        frsh_network_budget_to_bytes(FRSH_NETPF_FWP, &basic->budget, &bytes);
        vparams.budget = bytes;