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:26:04 +0000 (10:26 -0700)
commit46c9e8c1a833c77991257363b4bf1034f22e52ec
tree43b9b9c5415e7563f5f9926f393fc708854726d2
parentf02c843d8138a92d397ae5aff9027b9863fdd09d
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