Skip to content

Commit

Permalink
fix: Buffer out of bounds on appending signed long value to DTXMessag…
Browse files Browse the repository at this point in the history
…eAuxBuffer (#96)
  • Loading branch information
tomriddly authored Aug 23, 2022
1 parent 0fea4ee commit e9c5165
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/instrument/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ class DTXMessageAuxBuffer {
*/
appendSignedLong (value) {
const buf = Buffer.alloc(16);
this._buf.writeUInt32LE(DTX_AUXILIARY_MAGIC, 0);
this._buf.writeUInt32LE(6, 4);
this._buf.writeBigInt64LE(value, 8);
buf.writeUInt32LE(DTX_AUXILIARY_MAGIC, 0);
buf.writeUInt32LE(6, 4);
buf.writeBigInt64LE(value, 8);
this._buf = Buffer.concat([this._buf, buf]);
}

Expand Down Expand Up @@ -434,4 +434,4 @@ class DTXMessage {

export { DTXMessageHeader, DTXMessagePayloadHeader, DTXMessageAuxBuffer, DTXMessageAux, DTXMessage,
DTX_MESSAGE_PAYLOAD_HEADER_LENGTH, DTX_MESSAGE_HEADER_LENGTH, DTX_MESSAGE_HEADER_MAGIC, DTX_MESSAGE_HEADER_MAGIC_LEN,
FLAG_TYPES};
FLAG_TYPES};

0 comments on commit e9c5165

Please sign in to comment.