summaryrefslogtreecommitdiffstats
path: root/writecap/pcapio.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:51 +0000
commite27759aa56732ec1423a104333c1d88f5ddd7efb (patch)
tree489b146d4effcec44f246eb0b4d1c9f269c94b43 /writecap/pcapio.c
parentAdding upstream version 4.2.4. (diff)
downloadwireshark-e27759aa56732ec1423a104333c1d88f5ddd7efb.tar.xz
wireshark-e27759aa56732ec1423a104333c1d88f5ddd7efb.zip
Adding upstream version 4.2.5.upstream/4.2.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'writecap/pcapio.c')
-rw-r--r--writecap/pcapio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/writecap/pcapio.c b/writecap/pcapio.c
index e5a8c9d..58c4917 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;