Closed sve71 closed 6 years ago
Hi, it seems you have a malformed hep packet and reached this line chunkBody := hepChunk[6:chunkLength]
I thought I have enough checks that this case never occurs but it seems I must have missed one case. Lets go through my checks.
if int(length) != len(packet) {
return fmt.Errorf("HEP packet length is %d but should be %d", len(packet), length)
}
if len(hepChunk) < int(chunkLength) {
return fmt.Errorf("HEP chunk overflow %d > %d", chunkLength, len(hepChunk))
}
chunkBody := hepChunk[6:chunkLength]
Since chunkLength couldn't be greater than hepChunk due to the 2. check this means chunkLength is < 6
So I will change the 2. check to
if len(hepChunk) < int(chunkLength) || int(chunkLength) < 6 {
return fmt.Errorf("HEP chunkLength is wrong %d len hepChunk %d", chunkLength, len(hepChunk))
}
I will release today or mby tomorrow a new release with the fix. When you use heplify as hep client you can avoid hep and use protobuf. Simply run heplify with -protobuf flag
Latest release has a stronger hep validation and should catch your corner case. https://github.com/sipcapture/heplify-server/releases
If you still have issues feel free to reopen.
Hi,
I started heplify-sever on last Friday with:
./heplify-server&
Today I saw this:
Can anybody tell what was wrong with my instance of heplify-server?