Always use valid ids pointer in dec_ttl_cnt_ids_from_openflow()
authorSimon Horman <horms@verge.net.au>
Mon, 3 Jun 2013 05:46:30 +0000 (14:46 +0900)
committerBen Pfaff <blp@nicira.com>
Tue, 4 Jun 2013 17:25:57 +0000 (10:25 -0700)
commit70a8134dbc957f290d148a1985e6961931f41b14
treebb3f14d24bc89e8b01d3f82765ce1f016acd3436
parentb0f0cb95424043dbbe275fe1e2e787b44bfae9b4
Always use valid ids pointer in dec_ttl_cnt_ids_from_openflow()

Always update the ids pointer after calling ofpbuf_put()
to ensure that it is valid when accessed.

During testing a case came up where the call to ofpbuf_put() in the
for (i = 0; i < ids->n_controllers; i++) loop would cause the underlying
buffer to be reallocated. This resulted in ids->n_controllers being an
incorrect value, the loop continuing on longer than desired and finally a
segmentation fault.

Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-actions.c