From: Ethan Jackson Date: Tue, 28 Jun 2011 20:22:18 +0000 (-0700) Subject: ofp-parse: Fix invalid memory use. X-Git-Tag: v1.1.2~9 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=e51b8b03f936960d097fc642cb694d119829c054 ofp-parse: Fix invalid memory use. In some cases, parsing of the note action could cause a realloc which would result in the use of memory which was no longer allocated. --- diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index a3492cbc6..e58ae276a 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -440,6 +440,7 @@ str_to_action(char *str, struct ofpbuf *b) if (remainder) { ofpbuf_put_zeros(b, OFP_ACTION_ALIGN - remainder); } + nan = (struct nx_action_note *)((char *)b->data + start_ofs); nan->len = htons(b->size - start_ofs); } else if (!strcasecmp(act, "move")) { struct nx_action_reg_move *move;