mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
fix out of range index in headerIndex, github.com/buger/goreplay/issues/578
This commit is contained in:
@@ -93,6 +93,11 @@ func headerIndex(payload []byte, name []byte) int {
|
||||
return i - len(name)
|
||||
}
|
||||
|
||||
// We are at the end
|
||||
if i == len(payload) {
|
||||
return -1
|
||||
}
|
||||
|
||||
if payload[i] != name[j] {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user