]> git.proxmox.com Git - ovs.git/commitdiff
ofctl: break the loop if ovs_pcap_read returns error
authorLi RongQing <lirongqing@baidu.com>
Mon, 18 Feb 2019 02:56:38 +0000 (10:56 +0800)
committerBen Pfaff <blp@ovn.org>
Fri, 22 Feb 2019 21:03:42 +0000 (13:03 -0800)
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>
utilities/ovs-ofctl.c

index d8a31e39430158ef91cd0d2e8207124783bf8c3e..63620e4fb33124c04dff072aa8a50bb168f3f482 100644 (file)
@@ -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)));