diff options
author | Ben Pfaff <blp@nicira.com> | 2015-01-17 09:21:04 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-01-19 10:09:42 -0800 |
commit | 2021558e55c4f5bba5381b9bbae361d4491acc1c (patch) | |
tree | ed28a0da3655f7d64127826cb598f6ec9489f640 | |
parent | b36b0f4c4416b0bba445b49bbecc19c5711074c0 (diff) | |
download | openvswitch-2021558e55c4f5bba5381b9bbae361d4491acc1c.tar.gz |
pktbuf: Always initialize '*bufferp' even when 'pb == NULL'.
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c index 38ec34853..43b17c741 100644 --- a/ofproto/pktbuf.c +++ b/ofproto/pktbuf.c @@ -184,7 +184,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]; |