It reminds me another similar issue: http://openvswitch.org/pipermail/dev/2016-March/067313.html
Is there some way to avoid or make it harder to forgetting to update the pointer once ofpbuf_put_uninit reallocate to newly allocated memory? Regards, William On Tue, Apr 12, 2016 at 10:00 PM, Ben Pfaff <b...@ovn.org> wrote: > On Mon, Mar 07, 2016 at 11:12:40AM -0800, Joe Stringer wrote: > > As a separate thing, I was wondering about whether it's worthwhile to > > do something additional to try to avoid this kind of bug in future. A > > couple of ideas: > > * Rearrange the parse/decode functions so that ofpact_finish() is the > > final call within the decode_FOO()/parse_FOO() functions > > * Amend ofpact_finish() to have an additional 'void *localptr' > > parameter, so that the caller has to explicitly consider whether the > > pointer needs to be updated. > > > > Maybe the former is enough, perhaps + amend the comment above > > ofpact_finish() to make it more explicit that it may reallocate the > > buffer (and therefore invalidate local pointers in the caller > > context). > > I came up with an idea: > http://openvswitch.org/pipermail/dev/2016-April/069508.html > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev