flow: Fix use-after-free in flow_compose().
authorBen Pfaff <blp@nicira.com>
Wed, 4 Jun 2014 22:42:13 +0000 (15:42 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 5 Jun 2014 18:40:50 +0000 (11:40 -0700)
commit44d255fb4bd625a12aefe50bc30c1cd8a0eea1b6
tree23f2ea63481f675ca9e98998433e22299f99811a
parent5e5d6d8c1d502614a7482f7be5c8ba7e1654f0f0
flow: Fix use-after-free in flow_compose().

flow_compose_l4() can cause 'b' to be reallocated, thus the network header
pointer needs to be refreshed afterward.

Found by valgrind in the IPv6 case.  I updated the IPv4 case too just in
case, and for consistency.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/flow.c