diff options
author | Li RongQing <lirongqing@baidu.com> | 2019-02-18 10:56:38 +0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-02-22 13:03:42 -0800 |
commit | 8bdf4e674c95497c5f82e613d6388ff4ed569f55 (patch) | |
tree | 76050474d536b6e02798b3e65e7e40897a600aa3 | |
parent | 9307fc4600ea586ecf898754acb1b37762ce7748 (diff) | |
download | openvswitch-8bdf4e674c95497c5f82e613d6388ff4ed569f55.tar.gz |
ofctl: break the loop if ovs_pcap_read returns error
otherwise packet is NULL, and dereference it to cause segfault
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r-- | utilities/ovs-ofctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index d8a31e394..63620e4fb 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -4562,6 +4562,7 @@ ofctl_parse_pcap(struct ovs_cmdl_context *ctx) } else if (retval) { error = retval; ovs_error(error, "%s: read failed", filename); + break; } pkt_metadata_init(&packet->md, u32_to_odp(ofp_to_u16(OFPP_ANY))); |