From b5a8c4f72970927eafad323a48b4a99386a72347 Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Thu, 16 Jun 2016 01:25:03 +0200 Subject: randpktdump: fix a crash. Randpktdump requires the init the wtap opttypes. Fixed making the init function public and calling it. Bug: 12539 Change-Id: I02585c41012deacff1526b51ed09ab555cbfc8ce Reviewed-on: https://code.wireshark.org/review/15951 Petri-Dish: Anders Broman Reviewed-by: Martin Kaiser Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- randpkt_core/randpkt_core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'randpkt_core/randpkt_core.c') diff --git a/randpkt_core/randpkt_core.c b/randpkt_core/randpkt_core.c index 85759afb52..95c2ccf83e 100644 --- a/randpkt_core/randpkt_core.c +++ b/randpkt_core/randpkt_core.c @@ -30,6 +30,7 @@ #include #include #include "wsutil/file_util.h" +#include #ifdef _WIN32 #include @@ -677,6 +678,8 @@ void randpkt_example_init(randpkt_example* example, char* produce_filename, int { int err; + wtap_opttypes_initialize(); + if (strcmp(produce_filename, "-") == 0) { /* Write to the standard output. */ example->dump = wtap_dump_open_stdout(WTAP_FILE_TYPE_SUBTYPE_PCAP, -- cgit v1.2.1