Skip to content

Commit

Permalink
ofctl: break the loop if ovs_pcap_read returns error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lrq-max authored and blp committed Feb 22, 2019
1 parent 3d9cc0d commit 9ad0ffc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utilities/ovs-ofctl.c
Expand Up @@ -4240,6 +4240,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)));
Expand Down

0 comments on commit 9ad0ffc

Please sign in to comment.