summaryrefslogtreecommitdiff
path: root/lib/ofp-print.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2014-04-04 19:26:22 -0700
committerBen Pfaff <blp@nicira.com>2014-04-05 10:46:26 -0700
commitdea241f172b64958f6b917bc3971253c5dc010c0 (patch)
tree07f22845ee6d4ea519bb8fdd674f5c88f1089f67 /lib/ofp-print.c
parent5fa008d4618856aa44189cc98f71a7b3c5233652 (diff)
downloadopenvswitch-dea241f172b64958f6b917bc3971253c5dc010c0.tar.gz
ofp-print: Fix misaligned data access in ofp_print_error_msg().
The body of an OpenFlow error message often contains an inner OpenFlow message, and when it does, the inner message starts at an odd multiple of 4 bytes from the beginning of the outer message. That means that, on RISC systems, accessing the inner message directly causes a bus error. This commit fixes the problem in a way that should make it difficult to recur. This fixes the failure of tests 643, 645, and 651 on sparc seen here: https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=sparc&ver=2.1.0%2Bgit20140325-1&stamp=1396438624 Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Diffstat (limited to 'lib/ofp-print.c')
-rw-r--r--lib/ofp-print.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 60e2148fc..02f3db035 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1368,6 +1368,7 @@ ofp_print_error_msg(struct ds *string, const struct ofp_header *oh)
ds_put_cstr(string, s);
free(s);
}
+ ofpbuf_uninit(&payload);
}
static void