Giter Club home page Giter Club logo

hep-js's People

Contributors

adubovikov avatar dependabot[bot] avatar grumvalski avatar haeferer avatar lmangani avatar meuserj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hep-js's Issues

Incorrect Handling of HEP3 Chunks ends in Incorrect Payload strings (from Buffer)

Hi,

first thx for your work in HEP. We tried to use HepOp together with OpenSips, but HepOps fails on Sending our Messages to Postgres.

After going down to the root-problem we found a Problem with Handling of Chunks in HEP-JS:

hep-js/index.js

Lines 385 to 390 in 51b3221

var hepParse = new Parser()
.endianess("big")
.uint16("vendor")
.uint16("type")
.uint16("length")
.buffer("chunk", { length: "length" });

incorrectly implements the length of the chunk (line 390)

Correct would be

var hepParse = new Parser() 
   .endianess("big") 
   .uint16("vendor") 
   .uint16("type") 
   .uint16("length") 
   .buffer("chunk", { length: function() {return this.length - 6} })  ; // Vendor Typ and Length are part oft the length 

after this change the Patches at

hep-js/index.js

Line 422 in 51b3221

return { rcinfo: { capturePass: data.chunk.slice(0,data.chunk.length-6).toString() } };

hep-js/index.js

Line 426 in 51b3221

return { rcinfo: { correlation_id: data.chunk.slice(0,data.chunk.length-6).toString() } };

hep-js/index.js

Line 428 in 51b3221

return { rcinfo: { hepNodeName: data.chunk.slice(0,data.chunk.length-6).toString() } };

correcting the "too long" chunk must be removed!

The Root cause for our problem was the missing correction (-6) at line

hep-js/index.js

Line 424 in 51b3221

return { payload: data.chunk.toString() };

Without the correction the next Vendor ID (0x00) will be part of the string, and this crashes pg-promise during execution of SQL containing 0x00

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.