From f3579f39a408ae47c7e9cc7cf8f7b9decfd24a4e Mon Sep 17 00:00:00 2001 From: Simhon Doctori Date: Thu, 15 Aug 2013 12:02:16 +0300 Subject: [PATCH] Update actions.cc Fix CreateSetMplsTTL act_num needs to be increased --- src/lib/actions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/actions.cc b/src/lib/actions.cc index da7500c..e5ac856 100644 --- a/src/lib/actions.cc +++ b/src/lib/actions.cc @@ -124,7 +124,7 @@ Actions::CreateSetNwTTL(uint8_t nw_ttl){ void Actions::CreateSetMplsTTL(uint8_t mpls_ttl){ - acts = (struct ofl_action_header**) xrealloc(acts, sizeof(struct ofl_action_header *) * act_num); + acts = (struct ofl_action_header**) xrealloc(acts, sizeof(struct ofl_action_header *) * (act_num +1)); struct ofl_action_mpls_ttl *a = (struct ofl_action_mpls_ttl*) xmalloc(sizeof(struct ofl_action_mpls_ttl)); a->mpls_ttl = mpls_ttl; acts[act_num] = (struct ofl_action_header*) a;