From Jakub Zawadzki via bug 6002: Don't set state to STATE_EXPECT_DATA if there...
authorcmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 6 Jul 2011 16:22:11 +0000 (16:22 +0000)
committercmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 6 Jul 2011 16:22:11 +0000 (16:22 +0000)
Reference: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6002

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

dumpcap.c

index b5e3bca4bea76de16b582af4885015520834f704..34d342a39867e1ba0cbecd983da4ae537fb0ad4f 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2143,8 +2143,12 @@ cap_pipe_dispatch(loop_data *ld, pcap_options *pcap_opts, guchar *data, char *er
                        ld->packet_count+1, pcap_opts->cap_pipe_rechdr.hdr.incl_len);
             break;
         }
-        pcap_opts->cap_pipe_state = STATE_EXPECT_DATA;
-        return 0;
+
+        if (pcap_opts->cap_pipe_rechdr.hdr.incl_len) {
+            pcap_opts->cap_pipe_state = STATE_EXPECT_DATA;
+            return 0;
+        }
+        /* no data to read? fall through */
 
     case PD_DATA_READ:
         /* Fill in a "struct pcap_pkthdr", and process the packet. */