aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2014-06-25 15:37:36 -0400
committerEvan Huus <eapache@gmail.com>2014-06-27 00:48:51 +0000
commit9d4af5fccd4061521f72d42c2afb7fef78d3e690 (patch)
tree792a561669f89d803f7d5dc4e434fd75fa177a0c /tshark.c
parent4742fc8ed25f64822c711610e847298600319282 (diff)
Check the validity of fields given to tshark with "-e": complain and exit if
they aren't valid. Should help avoid confusion like that in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10201 Bug: 10201 Change-Id: Iff7f51ae042ca1a92d1c803b6cb61aa5d81ce205 Reviewed-on: https://code.wireshark.org/review/2654 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index bdb8046ee1..8d27037772 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1922,6 +1922,14 @@ main(int argc, char *argv[])
of the filter. We can now process all the "-z" arguments. */
start_requested_stats();
+ /* At this point MATE will have registered its field array so we can
+ check if the fields specified by the user are all good.
+ */
+ if (!output_fields_valid(output_fields)) {
+ cmdarg_err("Some fields aren't valid");
+ return 1;
+ }
+
#ifdef HAVE_LIBPCAP
/* We currently don't support taps, or printing dissected packets,
if we're writing to a pipe. */