From Jose Pedro Oliveira via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id...
authoralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Jan 2012 13:59:27 +0000 (13:59 +0000)
committeralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Jan 2012 13:59:27 +0000 (13:59 +0000)
pcapio.c: bug in libpcap_write_interface_description_block

The attached patch fixes a copy_and_paste error in the code of the function libpcap_write_interface_description_block(): strlen(name) instead of strlen(filter).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40423 f5534014-38df-0310-8fa8-9805f1628bb7

pcapio.c

index 575b9f76a60cb23e1c8eb00ce8cad869029162b6..6029532d72a23d924eca492f8877a0ed749a4897 100644 (file)
--- a/pcapio.c
+++ b/pcapio.c
@@ -330,12 +330,12 @@ libpcap_write_interface_description_block(FILE *fp,
                block_total_length += sizeof(struct option) +
                                      (guint16)(ADD_PADDING(strlen(name) + 1));
        }
-       if ((strlen(filter) > 0) && (strlen(name) < G_MAXUINT16)) {
+       if ((strlen(filter) > 0) && (strlen(filter) < G_MAXUINT16)) {
                block_total_length += sizeof(struct option) +
                                      (guint16)(ADD_PADDING(strlen(filter) + 1));
        }
        if (((strlen(name) > 0) && (strlen(name) < G_MAXUINT16)) ||
-           ((strlen(filter) > 0) && (strlen(name) < G_MAXUINT16))) {
+           ((strlen(filter) > 0) && (strlen(filter) < G_MAXUINT16))) {
                block_total_length += sizeof(struct option);
        }
        /* write block header */