diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-17 15:00:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-17 15:00:51 +0000 |
commit | e27759aa56732ec1423a104333c1d88f5ddd7efb (patch) | |
tree | 489b146d4effcec44f246eb0b4d1c9f269c94b43 /writecap/pcapio.c | |
parent | Adding upstream version 4.2.4. (diff) | |
download | wireshark-e27759aa56732ec1423a104333c1d88f5ddd7efb.tar.xz wireshark-e27759aa56732ec1423a104333c1d88f5ddd7efb.zip |
Adding upstream version 4.2.5.upstream/4.2.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | writecap/pcapio.c | 5 |
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; |