Skip to content

Commit

Permalink
Remove unused network buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadraju committed Jul 6, 2023
1 parent bae7dd1 commit bcc04fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/thin/sqlnet/packet.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function ConnectPacket(connectData, sAtts, flags = 0) {
}

/* Building Connect Packet */
this.buf = Buffer.alloc(size);
this.buf = Buffer.allocUnsafe(size).fill(0);
this.buf.writeUInt16BE(size, constants.NSPHDLEN);
this.buf.writeUInt8(flags, constants.NSPHDFLGS);
this.buf.writeUInt8(constants.NSPTCN, constants.NSPHDTYP);
Expand Down Expand Up @@ -156,7 +156,7 @@ function DataPacket(isLargeSDU) {
/* Building Data Packet */
this.dataPtr = constants.NSPDADAT;
this.dataLen = constants.NSPDADAT;
this.buf = Buffer.alloc(len);
this.buf = Buffer.allocUnsafe(len).fill(0);
this.buf.writeUInt8(0, constants.NSPHDFLGS);
this.buf.writeUInt8(constants.NSPTDA, constants.NSPHDTYP);
this.bufLen = len; /* Length of buffer */
Expand Down Expand Up @@ -377,7 +377,7 @@ function ControlPacket() {
} else if (err1 == NSESENDMESG) {
this.errno = err1;
this.notifLen = err2;
this.notif = Buffer.alloc(err2 + 1);
this.notif = Buffer.allocUnsafe(err2 + 1).fill(0);
this.buf.copy(this.notif, 0, constants.NSPCTLDAT + 12, constants.NSPCTLDAT + 12 + err2);
} else {
this.errno = err1;
Expand Down

0 comments on commit bcc04fe

Please sign in to comment.