ofproto: Fix bad memory access sending large numbers of port stats replies.
authorBen Pfaff <blp@nicira.com>
Mon, 26 Apr 2010 22:39:52 +0000 (15:39 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 26 Apr 2010 23:19:34 +0000 (16:19 -0700)
commita4948b95af9cfebb85ffcef9fbccc27b7a218a79
treeb367fcd9f5b7395c353a81ba7d252d580a5b230d
parent30f07f1a5e2a021d8e05167b5db93968a2036033
ofproto: Fix bad memory access sending large numbers of port stats replies.

The append_stats_reply() function can modify its pointer argument, but
append_port_stat() was failing to propagate this change back to its own
caller.  So when append_stats_reply() did in fact modify it (which happens
when the 64 kB maximum OpenFlow message length was exceeded), the
handle_port_stats_request() function would then access freed memory on the
next call to append_port_stat().

Bug #2714.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Debugging help by Justin Pettit <jpettit@nicira.com>
ofproto/ofproto.c