aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2023-02-01 21:14:10 -0500
committerJohn Thacker <johnthacker@gmail.com>2023-02-04 13:40:00 +0000
commit8cddc32d35e36d9962495c3d4358842ea88aac41 (patch)
tree03be895989a3a589500239aedb0e6cb3cabdcb7d /tshark.c
parent3aa44ba6aa39ed9123da5f8a91d1e901626513ca (diff)
cli: Process IDBs after the final packet record
Process IDBs that are read after the final packet record returned by wtap_read() in tshark, editcap, and mergecap. Ping #18449
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tshark.c b/tshark.c
index c12cbbdeb8..f5a8cbb3c3 100644
--- a/tshark.c
+++ b/tshark.c
@@ -3583,9 +3583,19 @@ process_cap_file_single_pass(capture_file *cf, wtap_dumper *pdh,
}
wtap_rec_reset(&rec);
}
- if (*err != 0 && status == PASS_SUCCEEDED) {
- /* Error reading from the input file. */
- status = PASS_READ_ERROR;
+ if (status == PASS_SUCCEEDED) {
+ if (*err != 0) {
+ /* Error reading from the input file. */
+ status = PASS_READ_ERROR;
+ } else {
+ /*
+ * Process whatever IDBs we haven't seen yet.
+ */
+ if (!process_new_idbs(cf->provider.wth, pdh, err, err_info)) {
+ *err_framenum = framenum;
+ status = PASS_WRITE_ERROR;
+ }
+ }
}
if (edt)