aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-08-29 14:16:52 -0400
committerHadriel Kaplan <hadrielk@yahoo.com>2015-08-29 19:01:53 +0000
commit605f33caaf5ccae26cd8f5c7ca5ac4813e0c40b2 (patch)
treed11bb4b3c1b42dfbcb8be36e7c0781d7792348d1 /wiretap
parenteacaa1aad8193780a2d977d5ab24f7a53368b774 (diff)
pcapng: handle NRB with options
If a pcapng Name Resolution Block has options, they should not screw up the pcapng reader and cause it to fail to read the file. Bug: 11485 Change-Id: Ic27cba937b6d93a3d9ed92522ed6b39ae2daeb8f Reviewed-on: https://code.wireshark.org/review/10307 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/pcapng.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 86945dcf89..647086170b 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -1719,8 +1719,8 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t
}
switch (nrb.record_type) {
case NRES_ENDOFRECORD:
- /* There shouldn't be any more data */
- to_read = 0;
+ /* There shouldn't be any more data - but there MAY be options */
+ goto read_options;
break;
case NRES_IP4RECORD:
/*
@@ -1856,6 +1856,10 @@ pcapng_read_name_resolution_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t
}
}
+
+read_options:
+ to_read -= block_read;
+
/* Options
* opt_comment 1
*