aboutsummaryrefslogtreecommitdiffstats
path: root/randpkt.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2006-04-26 17:31:56 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2006-04-26 17:31:56 +0000
commit44e48f80730ddd2bfe527dfa63ac8f9ddb097d2e (patch)
treec274c531e70d73df78683b9de040f306c8dcdc30 /randpkt.c
parent9d9f491cdf1ecd56af2edd2b92e5379666acadf8 (diff)
Check for NULL return value from wtap_dump_open().
Fixes coverity bug 159. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18005 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'randpkt.c')
-rw-r--r--randpkt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/randpkt.c b/randpkt.c
index 965189b06b..650b9dadc7 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -483,6 +483,10 @@ main(int argc, char **argv)
dump = wtap_dump_open(produce_filename, WTAP_FILE_PCAP,
example->sample_wtap_encap, produce_max_bytes, FALSE /* compressed */, &err);
+ if (!dump) {
+ printf("Error writing to %s\n", produce_filename);
+ exit(1);
+ }
seed();