mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Bugfix index out of bounds (\r\n\r\n split over two packets) (#632)
This commit is contained in:
@@ -220,8 +220,9 @@ func (t *TCPMessage) updateHeadersPacket() {
|
||||
t.headerPacket = i
|
||||
return
|
||||
}
|
||||
} else if bytes.Equal(p.Data, bBR) {
|
||||
if bytes.LastIndex(t.packets[i-1].Data, bBR) != -1 {
|
||||
} else if i > 0 && bytes.Equal(p.Data, bBR) {
|
||||
idx := bytes.LastIndex(t.packets[i-1].Data, bBR)
|
||||
if idx != -1 && idx == len(t.packets[i-1].Data)-len(bBR) {
|
||||
t.headerPacket = i
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user