[ovs-dev] [ofp-print 01/15] ofproto: Fix write-after-free error in compose_nx_flow_removed().

Justin Pettit jpettit at nicira.com
Tue Dec 14 22:07:17 UTC 2010


Looks good.  It may be nice to add a function-level description of nx_put_match().

--Justin


On Dec 14, 2010, at 12:23 PM, Ben Pfaff wrote:

> ---
> ofproto/ofproto.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 8b52b80..5cd76df 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -4698,10 +4698,10 @@ compose_nx_flow_removed(const struct rule *rule, uint8_t reason)
>     struct ofpbuf *buf;
>     int match_len;
> 
> -    nfr = make_nxmsg(sizeof *nfr, NXT_FLOW_REMOVED, &buf);
> +    make_nxmsg(sizeof *nfr, NXT_FLOW_REMOVED, &buf);
> 
>     match_len = nx_put_match(buf, &rule->cr);
> -
> +    nfr = buf->data;
>     nfr->cookie = rule->flow_cookie;
>     nfr->priority = htons(rule->cr.priority);
>     nfr->reason = reason;
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list