From: Ben Pfaff Date: Tue, 13 Apr 2010 17:30:28 +0000 (-0700) Subject: ovs-ofctl: Fix write before beginning of string in "add-flow". X-Git-Tag: v1.0.0~153 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=80bc2072c0f8b105142f7f30f202809127af87a5;p=sliver-openvswitch.git ovs-ofctl: Fix write before beginning of string in "add-flow". If "action" is the first word in a flow specification, then we were writing one byte before the beginning of the string. So overwrite the 'a' in "action" instead; we know it's really there. Reported-by: Ghanem Bahri --- diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 360f881ed..204e9582f 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -780,9 +780,9 @@ str_to_flow(char *string, struct ofp_match *match, struct ofpbuf *actions, if (!act_str) { ovs_fatal(0, "must specify an action"); } - *(act_str-1) = '\0'; + *act_str = '\0'; - act_str = strchr(act_str, '='); + act_str = strchr(act_str + 1, '='); if (!act_str) { ovs_fatal(0, "must specify an action"); }