diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-06-16 01:25:03 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-06-16 03:05:37 +0000 |
commit | b5a8c4f72970927eafad323a48b4a99386a72347 (patch) | |
tree | 11b59d166fd2f5df9cd6e317feb52b9723e8849a /randpkt_core/randpkt_core.c | |
parent | 79aab9232bf41132268a2887240140ee5a59a683 (diff) | |
download | wireshark-b5a8c4f72970927eafad323a48b4a99386a72347.tar.gz |
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 <a.broman58@gmail.com>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'randpkt_core/randpkt_core.c')
-rw-r--r-- | randpkt_core/randpkt_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 <stdlib.h> #include <string.h> #include "wsutil/file_util.h" +#include <wiretap/wtap_opttypes.h> #ifdef _WIN32 #include <wsutil/unicode-utils.h> @@ -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, |