summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-01-17 09:21:04 -0800
committerBen Pfaff <blp@nicira.com>2015-01-19 10:09:56 -0800
commit8ef40319f430f19a41148e622189f1930737490d (patch)
tree7088e704aa02f3c6dfe90b285ac715e0b3a03554
parent3ab8c8e51a5542a744b9fa8dc235a5bc6d9bad1a (diff)
downloadopenvswitch-branch-1.9.tar.gz
pktbuf: Always initialize '*bufferp' even when 'pb == NULL'.branch-1.9
Otherwise if a service connection (which does not have buffers) attempts to use buffers, '*bufferp' will be uninitialized, which can cause a segfault in the caller. Found using OFtest configured to use service (active rather than passive) connections. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Thomas Graf <tgraf@noironetworks.com>
-rw-r--r--ofproto/pktbuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c
index 71be34a61..1b45d8d58 100644
--- a/ofproto/pktbuf.c
+++ b/ofproto/pktbuf.c
@@ -185,7 +185,8 @@ pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct ofpbuf **bufferp,
if (!pb) {
VLOG_WARN_RL(&rl, "attempt to send buffered packet via connection "
"without buffers");
- return OFPERR_OFPBRC_BUFFER_UNKNOWN;
+ error = OFPERR_OFPBRC_BUFFER_UNKNOWN;
+ goto error;
}
p = &pb->packets[id & PKTBUF_MASK];