summaryrefslogtreecommitdiffstats
path: root/writecap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:52 +0000
commit0f157e7d6c4be48f213ea022cb2d6d1316c423c8 (patch)
treeff4ad271b50a39e23d5a50a54f4bff37342cdc1c /writecap
parentAdding debian version 4.2.4-1. (diff)
downloadwireshark-0f157e7d6c4be48f213ea022cb2d6d1316c423c8.tar.xz
wireshark-0f157e7d6c4be48f213ea022cb2d6d1316c423c8.zip
Merging upstream version 4.2.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'writecap')
-rw-r--r--writecap/pcapio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/writecap/pcapio.c b/writecap/pcapio.c
index e5a8c9de..58c49179 100644
--- a/writecap/pcapio.c
+++ b/writecap/pcapio.c
@@ -425,7 +425,7 @@ pcapng_write_interface_description_block(FILE* pfile,
}
/* 11 - IDB_FILTER */
- if ((filter != NULL) && (strlen(filter) > 0) && (strlen(filter) < UINT16_MAX)) {
+ if ((filter != NULL) && (strlen(filter) > 0) && (strlen(filter) < UINT16_MAX - 1)) {
/* No, this isn't a string, it has an extra type byte */
options_length += (uint32_t)(sizeof(struct ws_option) +
(uint16_t)(ADD_PADDING(strlen(filter)+ 1)));
@@ -496,7 +496,8 @@ pcapng_write_interface_description_block(FILE* pfile,
}
/* 11 - IDB_FILTER - write filter string if applicable
- * We only write version 1 of the filter, pcapng string
+ * We write out the libpcap filter expression, not the
+ * generated BPF code.
*/
if ((filter != NULL) && (strlen(filter) > 0) && (strlen(filter) < UINT16_MAX - 1)) {
option.type = IDB_FILTER;