Message ID | 1550458598-15921-1-git-send-email-lirongqing@baidu.com |
---|---|
State | Accepted |
Commit | 8bdf4e674c95497c5f82e613d6388ff4ed569f55 |
Headers | show |
Series | [ovs-dev] ofctl: break the loop if ovs_pcap_read returns error | expand |
On Mon, Feb 18, 2019 at 10:56:38AM +0800, Li RongQing wrote: > otherwise packet is NULL, and dereference it to cause segfault > > Signed-off-by: Li RongQing <lirongqing@baidu.com> Thanks! I applied this to master and backported it as far as branch-2.6.
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)));
otherwise packet is NULL, and dereference it to cause segfault Signed-off-by: Li RongQing <lirongqing@baidu.com> --- utilities/ovs-ofctl.c | 1 + 1 file changed, 1 insertion(+)