aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2021-12-01 09:16:45 -0800
committerGuy Harris <gharris@sonic.net>2021-12-02 04:06:59 +0000
commitfcf945f7479d8770fc25f5bd7ec2cce1f9b77b28 (patch)
tree3292dfe5ef66a8f96f7430fb1d4a13325dbff888 /wiretap
parentcf0ecc4fe155d0698c46bec82f11cabb26c3a878 (diff)
wiretap: Fix an underflow in pcapng.
Make sure account for our rounded option length when we process opt_endofopt. Fixes #17755.
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/pcapng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 6e4004c22b..9a0aa99806 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -987,7 +987,7 @@ pcapng_process_options(FILE_T fh, wtapng_block_t *wblock,
ws_debug("%u bytes after opt_endofopt", opt_bytes_remaining);
}
/* padding should be ok here, just get out of this */
- opt_bytes_remaining = 0;
+ opt_bytes_remaining = rounded_option_length;
break;
case(OPT_COMMENT):
pcapng_process_string_option(wblock, option_code, option_length,