Code Monkey home page Code Monkey logo

Comments (4)

negbie avatar negbie commented on September 21, 2024

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.

  1. First I check if the packetlength is the same like the heplength this is how it looks like in code:
	if int(length) != len(packet) {
		return fmt.Errorf("HEP packet length is %d but should be %d", len(packet), length)
	}
  1. For every chunck I check if the chuncklength isn't greater than the remaining hepChunks:
		if len(hepChunk) < int(chunkLength) {
			return fmt.Errorf("HEP chunk overflow %d > %d", chunkLength, len(hepChunk))
		}
  1. You get to following line and heplify-server crashes:
    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))
		}

from heplify-server.

negbie avatar negbie commented on September 21, 2024

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

from heplify-server.

negbie avatar negbie commented on September 21, 2024

Latest release has a stronger hep validation and should catch your corner case.
https://github.com/sipcapture/heplify-server/releases

from heplify-server.

negbie avatar negbie commented on September 21, 2024

If you still have issues feel free to reopen.

from heplify-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.