Back out r54523 - more work is needed on it, and some testing found an
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 1 Jan 2014 23:19:17 +0000 (23:19 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 1 Jan 2014 23:19:17 +0000 (23:19 +0000)
unrelated uninitialized-data bug that I want to fix in the next commit,
and then backport.

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

wiretap/ngsniffer.c

index cc86c1074f1c4c0bc1ec894f151ea734b20fa47d..9c1862350413d80bbdb22cd6110ea9b698a36fb1 100644 (file)
@@ -1224,18 +1224,10 @@ found:
        /*
         * Read the packet data.
         */
-       if (!ngsniffer_read_rec_data(wth, FALSE, wth->frame_buffer, size,
+       if (!ngsniffer_read_rec_data(wth, FALSE, wth->frame_buffer, length,
            err, err_info))
                return FALSE;   /* Read error */
 
-       /*
-        * Skip any extra data in the record.
-        */
-       if (size < length) {
-               if (!ng_file_skip_seq(wth, length - size, err, err_info))
-                       return FALSE;
-       }
-
        wth->phdr.pkt_encap = fix_pseudo_header(wth->file_encap, wth->frame_buffer, length,
            &wth->phdr.pseudo_header);
 
@@ -1274,7 +1266,7 @@ found:
 
 static gboolean
 ngsniffer_seek_read(wtap *wth, gint64 seek_off,
-    struct wtap_pkthdr *phdr, Buffer *buf, int packet_size _U_,
+    struct wtap_pkthdr *phdr, Buffer *buf, int packet_size,
     int *err, gchar **err_info)
 {
        union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header;
@@ -1347,10 +1339,10 @@ ngsniffer_seek_read(wtap *wth, gint64 seek_off,
        /*
         * Got the pseudo-header (if any), now get the data.
         */
-       if (!ngsniffer_read_rec_data(wth, TRUE, buf, phdr->caplen, err, err_info))
+       if (!ngsniffer_read_rec_data(wth, TRUE, buf, packet_size, err, err_info))
                return FALSE;
 
-       fix_pseudo_header(wth->file_encap, buf, phdr->caplen, pseudo_header);
+       fix_pseudo_header(wth->file_encap, buf, packet_size, pseudo_header);
 
        return TRUE;
 }