Skip to content

Commit

Permalink
Slice packet depending on caplen, not length
Browse files Browse the repository at this point in the history
  • Loading branch information
mildsunrise committed Feb 14, 2020
1 parent 241b902 commit 240d799
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion decode/pcap_packet.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PcapPacket.prototype.decode = function (packet_with_header) {
this.link_type = packet_with_header.link_type;
this.pcap_header = new PcapHeader(packet_with_header.header);

var buf = packet_with_header.buf.slice(0, this.pcap_header.len);
var buf = packet_with_header.buf.slice(0, this.pcap_header.caplen);

switch (this.link_type) {
case "LINKTYPE_ETHERNET":
Expand Down

0 comments on commit 240d799

Please sign in to comment.