Skip to content

Commit

Permalink
reassembly: fix check overlap for case 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhandos Zhylkaidar authored and gconnell committed Oct 19, 2020
1 parent 78e86bc commit a9779d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reassembly/tcpassembly.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ func (a *Assembler) checkOverlap(half *halfconnection, queue bool, ac AssemblerC
} else

// end < cur.end && start > cur.start: replace bytes inside cur (6)
if diffEnd > 0 && diffStart < 0 {
if diffEnd >= 0 && diffStart <= 0 {
if *debugLog {
log.Printf("case 6\n")
}
Expand Down
4 changes: 2 additions & 2 deletions reassembly/tcpassembly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ func TestBufferedOverlapCase6(t *testing.T) {
in: layers.TCP{
SrcPort: 1,
DstPort: 2,
Seq: 1010,
BaseLayer: layers.BaseLayer{Payload: []byte{10, 11, 12, 13, 14}},
Seq: 1007,
BaseLayer: layers.BaseLayer{Payload: []byte{7, 8, 9, 10, 11, 12, 13, 14}},
},
want: []Reassembly{},
},
Expand Down

0 comments on commit a9779d1

Please sign in to comment.