Coder Social home page Coder Social logo

Comments (8)

fiorix avatar fiorix commented on June 14, 2024

Is this an AVP you're getting off the wire or an AVP you're generating?
If it's from the network please provide me with a pcap to take a look. Otherwise you should provide the empty payload, which is an interface and currently cannot be nil. We could definitely talk about adding checks to all data types but that might cost performance.

from go-diameter.

taseppa avatar taseppa commented on June 14, 2024

I'm getting this off wire. I would be happy to provide pcap but the AVPs contain some potentially sensitive information I can't share.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

So you're saying the parser crash when a FailedAVP is received, containing the failed AVP with empty data? I can't reproduce that.

from go-diameter.

jaroszan avatar jaroszan commented on June 14, 2024

@taseppa: may be you can provide which failed AVP you are receiving and code for the parser? Some relevant text extract from pcap without sensitive information?

from go-diameter.

taseppa avatar taseppa commented on June 14, 2024

It should happen with every AVP that is of type unsigned32. If you check unsigned32.go:17

return Unsigned32(binary.BigEndian.Uint32(b)), nil

This will panic if byte array is empty http://play.golang.org/p/6ctpKdZ0H0

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

This patch should fix it, let me know otherwise.

from go-diameter.

fiorix avatar fiorix commented on June 14, 2024

At some point we might want to do some more strict checks in all these decoder functions to ensure the data is the exact length we want. If zero (the case of embedded in FailedAVP) we return default value, if exact length we decode, other than that we return error.

from go-diameter.

taseppa avatar taseppa commented on June 14, 2024

This patch looks good, thanks!

from go-diameter.

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.